-
Notifications
You must be signed in to change notification settings - Fork 0
/
wizard03.html
206 lines (162 loc) · 8.12 KB
/
wizard03.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<!--[if IE 8]><html class="ie8"><![endif]-->
<!--[if IE 9]><html class="ie9"><![endif]-->
<!--[if gt IE 9]><!-->
<html>
<!--<![endif]-->
<head>
<title>AeroGear UnifiedPush Server</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<link rel="shortcut icon" href="../dist/img/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../dist/img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../dist/img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../dist/img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../dist/img/apple-touch-icon-57-precomposed.png">
<link href="css/styles.css" rel="stylesheet" media="screen, print">
<!-- <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="bower_components/patternfly/components/html5shiv/dist/html5shiv.min.js"></script>
<script src="bower_components/patternfly/components/respond/dest/respond.min.js"></script>
<![endif]-->
<!-- IE8 requires jQuery and Bootstrap JS to load in head to prevent rendering bugs -->
<!-- IE8 requires jQuery v1.x -->
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="bower_components/patternfly/components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="bower_components/patternfly/components/datatables/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="bower_components/patternfly/components/bootstrap-select/bootstrap-select.min.js"></script>
<script type="text/javascript" src="bower_components/patternfly/dist/js/patternfly.min.js"></script>
<script type="text/javascript" src="bower_components/google-code-prettify/bin/prettify.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-pf" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img src="img/brand.svg" alt="Aerogear" />
</a>
</div>
<div class="collapse navbar-collapse navbar-collapse-1">
<ul class="nav navbar-nav navbar-utility">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="pficon pficon-user"></span>
Brian Johnson <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="#">Accont management</a>
</li>
<li class="divider"></li>
<li>
<a href="#">Logout</a>
</li>
</ul>
</li>
</ul>
</div>
<div class="collapse navbar-collapse navbar-collapse-1">
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="col-sm-8 col-md-9">
<div class="page-header page-header-bleed-right">
<div class="actions pull-right">
<ul class="list-inline">
<li><a href="#"><span class="pficon pficon-edit"></span> Edit Name</a></li>
</ul>
</div>
<h1>Application Name</h1>
</div>
<div class="actions pull-right">
<ul class="list-inline">
<li><a href="#"><span class="pficon pficon-edit"></span> Edit Variant</a></li>
</ul>
</div>
<h2 class="ups-variant-name-header ups-has-icon ups-variant-android">
<strong>Name of the variant:</strong>
<span class="muted"><i class="fa fa-ban"></i> No installation yet</span>
</h2>
<p><strong>We are half way there!</strong> Use the code snippet bellow to <a href="#">register your device</a> and allow it to receiving notifications through this UnifiedPush Server. If you don't know how to do this, <a href="#">go to the documentation for full sept by step explanation</a>.</p>
<ol>
<li>Copy the code snippet and paste it on your device code.</li>
<li>Build and deploy your app.</li>
<li>Click <a href="wizard04.html">Continue (Bellow)</a></li>
</ol>
<div class="ups-snippet">
<a href="#" data-toggle="tooltip" data-placement="left" title="Copy to clipboard">Copy</a>
<pre class="pre-scrollable prettyprint">
package com.push.pushapplication;
import java.net.URI;
import java.net.URISyntaxException;
import org.jboss.aerogear.android.unifiedpush.PushConfig;
import org.jboss.aerogear.android.unifiedpush.PushRegistrar;
import org.jboss.aerogear.android.unifiedpush.Registrations;
import android.app.Application;
public class PushApplication extends Application {
private final String VARIANT_ID = "7d37fd1a-82c1-48c8-be94-6456f26075fc";
private final String SECRET = "c6dc8b14-0c6f-4f41-8835-2a87827ee1f4";
private final String GCM_SENDER_ID = "33";
private final String UNIFIED_PUSH_URL = "http://localhost:8080/ag-push/";
private PushRegistrar registration;
@Override
public void onCreate() {
super.onCreate();
Registrations registrations = new Registrations();
try {
PushConfig config = new PushConfig(new URI(UNIFIED_PUSH_URL), GCM_SENDER_ID);
config.setVariantID(VARIANT_ID);
config.setSecret(SECRET);
config.setAlias(MY_ALIAS);
registration = registrations.push("unifiedpush", config);
registration.register(getApplicationContext(), new Callback() {
private static final long serialVersionUID = 1L;
@Override
public void onSuccess(Void ignore) {
Toast.makeText(MainActivity.this, "Registration Succeeded!",
Toast.LENGTH_LONG).show();
}
@Override
public void onFailure(Exception exception) {
Log.e("MainActivity", exception.getMessage(), exception);
}
});
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
}
</pre>
</div>
<p>Next we are going to send a test notification. Make sure you <a href="#">build or deploy your app</a> after pasting the snnipet.</p>
<div class="actions pull-right ups-wizard-actions">
<a href="wizard04.html" class="btn btn-primary btn-lg">Continue <i class="fa fa-angle-double-right"></i></a>
</div>
</div><!-- /col -->
<div class="col-sm-4 col-md-3 sidebar-pf sidebar-pf-right">
<div class="sidebar-header sidebar-header-bleed-left sidebar-header-bleed-right">
<div class="actions pull-right">
<a href="#"><a href="app-detail-blank.html">Skip the wizard <i class="fa fa-angle-double-right"></i></a>
</div>
<h2 class="h5">Wizard steps</h2>
</div>
<ol class="list-unstyled ups-steps">
<li class="done"><strong><i class="fa fa-check"></i></strong> Create your first Application</li>
<li class="done"><strong><i class="fa fa-check"></i></strong> Add a variant</li>
<li class="active"><strong>3</strong> Mobile device: Set up variant</li>
<li><strong>4</strong> Test! Send notification</li>
<li><strong>5</strong> Backend: Set up sender API</li>
</ol>
</div><!-- /col -->
</div><!-- /row -->
</div><!-- /container -->
</body>
</html>