OLD | NEW |
1 <h1 id="add-alarms-notifications"> | 1 <h1 id="add-alarms-notifications"> |
2 <span class="h1-step">Step 3:</span> | 2 <span class="h1-step">Step 3:</span> |
3 Add Alarms and Notifications | 3 Add Alarms and Notifications |
4 </h1> | 4 </h1> |
5 | 5 |
6 <p class="note"> | 6 <p class="note"> |
7 <strong>Want to start fresh from here?</strong> | 7 <strong>Want to start fresh from here?</strong> |
8 Find the previous step's code in the <a href="https://github.com/mangini/io13-
codelab/archive/master.zip">reference code zip</a> under <strong><em>cheat_code
> solution_for_step2</strong></em>. | 8 Find the previous step's code in the <a href="https://github.com/mangini/io13-
codelab/archive/master.zip">reference code zip</a> under <strong><em>cheat_code
> solution_for_step2</strong></em>. |
9 </p> | 9 </p> |
10 | 10 |
11 <p>In this step, you will learn:</p> | 11 <p>In this step, you will learn:</p> |
12 | 12 |
13 <ul> | 13 <ul> |
14 <li>How to wake your app at specified intervals to execute background tasks.</
li> | 14 <li>How to wake your app at specified intervals to execute background tasks.</
li> |
15 <li>How to use on-screen notifications to draw attention to something importan
t.</li> | 15 <li>How to use on-screen notifications to draw attention to something importan
t.</li> |
16 </ul> | 16 </ul> |
17 | 17 |
18 <p> | 18 <p> |
19 <em>Estimated time to complete this step: 20 minutes.</em> | 19 <em>Estimated time to complete this step: 20 minutes.</em> |
20 <br> | 20 <br> |
21 To preview what you will complete in this step, <a href="#launch">jump down to
the bottom of this page ↓</a>. | 21 To preview what you will complete in this step, <a href="#launch">jump down to
the bottom of this page ↓</a>. |
22 </p> | 22 </p> |
23 | 23 |
24 <h2 id="overview">Enhance your Todo app with reminders</h2> | 24 <h2 id="overview">Enhance your Todo app with reminders</h2> |
25 | 25 |
26 <p>Let's enhance our Todo app by adding functionality to remind the user if they
have open todos — even when the | 26 <p>Enhance the Todo app by adding functionality to remind the user if they have
open todos — even when the app is closed.</p> |
27 app is closed.</p> | |
28 | 27 |
29 <p>First, we must add a way for our app to regularly check for uncompleted todos
. Next, we need to display a message to the user, even if the Todo app window is
closed. To accomplish this, we will learn about implementing alarms and notific
ations in Chrome Apps.</p> | 28 <p>First, you need to add a way for the app to regularly check for uncompleted t
odos. Next, the app needs to display a message to the user, even if the Todo app
window is closed. To accomplish this, you need to understand how alarms and not
ifications work in Chrome Apps.</p> |
30 | 29 |
31 <h2 id="alarms">Add alarms</h2> | 30 <h2 id="alarms">Add alarms</h2> |
32 | 31 |
33 <p>Use <a href="/apps/alarms.html"><code>chrome.alarms</code></a> | 32 <p>Use <a href="/apps/alarms.html"><code>chrome.alarms</code></a> |
34 to set a wake up interval. As long as Chrome is running, the alarm listener will
be called at | 33 to set a wake up interval. As long as Chrome is running, the alarm listener is c
alled at |
35 approximately the interval set.</p> | 34 approximately the interval set.</p> |
36 | 35 |
37 <h3 id="update-permissions-alarms">Update app permissions</h3> | 36 <h3 id="update-permissions-alarms">Update app permissions</h3> |
38 | 37 |
39 <p>In <strong><em>manifest.json</em></strong>, request the <code>"alarms"</code>
permission:</p> | 38 <p>In <strong><em>manifest.json</em></strong>, request the <code>"alarms"</code>
permission:</p> |
40 | 39 |
41 <pre data-filename="manifest.json"> | 40 <pre data-filename="manifest.json"> |
42 "permissions": ["storage"<b>, "alarms"</b>], | 41 "permissions": ["storage"<b>, "alarms"</b>], |
43 </pre> | 42 </pre> |
44 | 43 |
(...skipping 18 matching lines...) Expand all Loading... |
63 | 62 |
64 <p>In <strong><em>index.html</em></strong>, add an <strong>Activate alarm</stron
g> button:</p> | 63 <p>In <strong><em>index.html</em></strong>, add an <strong>Activate alarm</stron
g> button:</p> |
65 | 64 |
66 <pre data-filename="index.html"> | 65 <pre data-filename="index.html"> |
67 <footer id="info"> | 66 <footer id="info"> |
68 <b><button id="toggleAlarm">Activate alarm</button></b> | 67 <b><button id="toggleAlarm">Activate alarm</button></b> |
69 ... | 68 ... |
70 </footer> | 69 </footer> |
71 </pre> | 70 </pre> |
72 | 71 |
73 <p>We now need to write the JavaScript event handler for this new button but rec
all from <a href="/apps/app_codelab_import_todomvc#csp-compliance">Step 2</a> th
at one of the most common CSP non-compliances is caused by inline JavaScript. St
ill in <em>index.html</em>, add this line to import a new <em>alarms.js</em> | 72 <p>You now need to write the JavaScript event handler for this new button. |
74 file we will create in the following step:</p> | 73 Recall from <a href="/apps/app_codelab_import_todomvc#csp-compliance">Step 2</a> |
| 74 that one of the most common CSP non-compliances is caused by inline JavaScript. |
| 75 In <em>index.html</em>, add this line to import a new <em>alarms.js</em> |
| 76 file which you will create in the following step:</p> |
75 | 77 |
76 <pre data-filename="index.html"> | 78 <pre data-filename="index.html"> |
77 </footer> | 79 </footer> |
78 ... | 80 ... |
79 <script src="js/app.js"></script> | 81 <script src="js/app.js"></script> |
80 <b><script src="js/alarms.js"></script></b> | 82 <b><script src="js/alarms.js"></script></b> |
81 </body> | 83 </body> |
82 </pre> | 84 </pre> |
83 | 85 |
84 <h3 id="add-alarms-script">Create alarms script</h3> | 86 <h3 id="add-alarms-script">Create alarms script</h3> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 156 |
155 <ul> | 157 <ul> |
156 <li>Even when you close the Todo app window, the alarms will keep coming.</li> | 158 <li>Even when you close the Todo app window, the alarms will keep coming.</li> |
157 <li>On platforms other than ChromeOS, if you completely close all Chrome brows
er instances, alarms won't trigger.</li> | 159 <li>On platforms other than ChromeOS, if you completely close all Chrome brows
er instances, alarms won't trigger.</li> |
158 </ul> | 160 </ul> |
159 | 161 |
160 <p>Let's go over some of the pieces in <em>alarms.js</em> that use <code>chrome.
alarms</code> methods one by one.</p> | 162 <p>Let's go over some of the pieces in <em>alarms.js</em> that use <code>chrome.
alarms</code> methods one by one.</p> |
161 | 163 |
162 <h3 id="create-alarms">Create alarms</h3> | 164 <h3 id="create-alarms">Create alarms</h3> |
163 | 165 |
164 <p>In <code>createAlarm()</code>, we use the <a href="/apps/alarms#method-create
"><code>chrome.alarms.create()</code></a> API to create an alarm when <strong>Ac
tivate alarm</strong> is toggled.</p> | 166 <p>In <code>createAlarm()</code>, use the <a href="/apps/alarms#method-create"><
code>chrome.alarms.create()</code></a> API to create an alarm when <strong>Activ
ate alarm</strong> is toggled.</p> |
165 | 167 |
166 <pre data-filename="alarms.js"> | 168 <pre data-filename="alarms.js"> |
167 chrome.alarms.create(alarmName, {delayInMinutes: 0.1, periodInMinutes: 0.1}); | 169 chrome.alarms.create(alarmName, {delayInMinutes: 0.1, periodInMinutes: 0.1}); |
168 </pre> | 170 </pre> |
169 | 171 |
170 <p>The first parameter is an optional string identifying an unique name for your
alarm. In our case, the alarm name is <code>remindme</code>. (Note: You need to
set an alarm name in order to cancel it by name.)</p> | 172 <p>The first parameter is an optional string identifying an unique name for your
alarm, |
| 173 for example, <code>remindme</code>. |
| 174 (Note: You need to set an alarm name in order to cancel it by name.)</p> |
171 | 175 |
172 <p>The second parameter is an <code>alarmInfo</code> object. Valid properties fo
r <code>alarmInfo</code> include <code>when</code> or <code>delayInMinutes</code
>, and <code>periodInMinutes</code>. In order to reduce the load on the user's m
achine, Chrome limits alarms to once every minute. | 176 <p>The second parameter is an <code>alarmInfo</code> object. Valid properties fo
r <code>alarmInfo</code> include <code>when</code> or <code>delayInMinutes</code
>, and <code>periodInMinutes</code>. In order to reduce the load on the user's m
achine, Chrome limits alarms to once every minute. |
173 We are using small values (0.1 of a minute) here for demo purposes only.</p> | 177 We are using small values (0.1 of a minute) here for demo purposes only.</p> |
174 | 178 |
175 <h3 id="clear-alarms">Clear alarms</h3> | 179 <h3 id="clear-alarms">Clear alarms</h3> |
176 | 180 |
177 <p>In <code>cancelAlarm()</code>, we use the <a href="/apps/alarms#method-clear"
><code>chrome.alarms.clear()</code></a> API to cancel an alarm when <strong>Canc
el alarm</strong> is toggled.</p> | 181 <p>In <code>cancelAlarm()</code>, use the <a href="/apps/alarms#method-clear"><c
ode>chrome.alarms.clear()</code></a> API to cancel an alarm when <strong>Cancel
alarm</strong> is toggled.</p> |
178 | 182 |
179 <pre data-filename="alarms.js"> | 183 <pre data-filename="alarms.js"> |
180 chrome.alarms.clear(alarmName); | 184 chrome.alarms.clear(alarmName); |
181 </pre> | 185 </pre> |
182 | 186 |
183 <p>The first parameter should be the identifying string you used as an alarm nam
e in <code>chrome.alarms.create()</code>.</p> | 187 <p>The first parameter should be the identifying string you used as an alarm nam
e in <code>chrome.alarms.create()</code>.</p> |
184 | 188 |
185 <p>The second (optional) parameter is a callback function that should take on th
e format:</p> | 189 <p>The second (optional) parameter is a callback function that should take on th
e format:</p> |
186 | 190 |
187 <pre>function(boolean wasCleared) {...};</pre> | 191 <pre>function(boolean wasCleared) {...};</pre> |
188 | 192 |
189 <h3 id="get-alarms">Get alarms</h3> | 193 <h3 id="get-alarms">Get alarms</h3> |
190 | 194 |
191 <p>In <code>checkAlarm()</code>, we use the <a href="/apps/alarms#method-getAll"
><code>chrome.alarms.getAll()</code></a> API to get an array of all created alar
ms in order to update the UI state of the toggle button.</p> | 195 <p>In <code>checkAlarm()</code>, use the <a href="/apps/alarms#method-getAll"><c
ode>chrome.alarms.getAll()</code></a> API to get an array of all created alarms
in order to update the UI state of the toggle button.</p> |
192 | 196 |
193 <p><code>getAll()</code> accepts a callback function that passes in an array of
<code>Alarm</code> objects. To see what's in an <code>Alarm</code>, you can insp
ect running alarms in the DevTools Console like so:</p> | 197 <p><code>getAll()</code> accepts a callback function that passes in an array of
<code>Alarm</code> objects. To see what's in an <code>Alarm</code>, you can insp
ect running alarms in the DevTools Console like so:</p> |
194 | 198 |
195 <pre> | 199 <pre> |
196 chrome.alarms.getAll(function(alarms) { | 200 chrome.alarms.getAll(function(alarms) { |
197 console.log(alarms); | 201 console.log(alarms); |
198 console.log(alarms[0]); | 202 console.log(alarms[0]); |
199 }); | 203 }); |
200 </pre> | 204 </pre> |
201 | 205 |
202 <p>This will output an object such as <code>{name: "remindme", periodInMinutes:
0.1, scheduledTime: 1397587981166.858}</code> as seen below:</p> | 206 <p>This will output an object such as <code>{name: "remindme", periodInMinutes:
0.1, scheduledTime: 1397587981166.858}</code> as seen below:</p> |
203 | 207 |
204 <figure> | 208 <figure> |
205 <img src="{{static}}/images/app_codelab/alarms-getAll-console.png" alt="Use ge
tAll() to inspect running alarms."/> | 209 <img src="{{static}}/images/app_codelab/alarms-getAll-console.png" alt="Use ge
tAll() to inspect running alarms."/> |
206 </figure> | 210 </figure> |
207 | 211 |
208 <h3 id="next-section">Get ready for the next section</h3> | 212 <h3 id="next-section">Get ready for the next section</h3> |
209 | 213 |
210 <p>Now that we have alarms in place to poll our app at regular intervals, we can
use it as a base for adding visual notifications — which is exactly what
we'll do in the next section.</p> | 214 <p>Now that alarms are in place to poll the app at regular intervals, use this a
s a base for adding visual notifications.</p> |
211 | 215 |
212 <h2 id="notifications">Add notifications</h2> | 216 <h2 id="notifications">Add notifications</h2> |
213 | 217 |
214 <p>Let's change the alarm notification to something the user can easily notice. | 218 <p>Let's change the alarm notification to something the user can easily notice. |
215 For that purpose, we will use <a href="/apps/notifications"><code>chrome.notific
ations</code></a> | 219 Use <a href="/apps/notifications"><code>chrome.notifications</code></a> |
216 to show a desktop notification like the one below:</p> | 220 to show a desktop notification like the one below:</p> |
217 | 221 |
218 <figure> | 222 <figure> |
219 <img src="{{static}}/images/app_codelab/notification-example.png" alt="Our Tod
o app notification"/> | 223 <img src="{{static}}/images/app_codelab/notification-example.png" alt="Our Tod
o app notification"/> |
220 </figure> | 224 </figure> |
221 | 225 |
222 <p>When the user clicks on the notification, we will bring the Todo app window i
nto view.</p> | 226 <p>When the user clicks on the notification, the Todo app window should come int
o view.</p> |
223 | 227 |
224 <h3 id="update-permissions-notifications">Update app permissions</h3> | 228 <h3 id="update-permissions-notifications">Update app permissions</h3> |
225 | 229 |
226 <p>In <strong><em>manifest.json</em></strong>, request the <code>"notifications"
</code> permission:</p> | 230 <p>In <strong><em>manifest.json</em></strong>, request the <code>"notifications"
</code> permission:</p> |
227 | 231 |
228 <pre data-filename="manifest.json"> | 232 <pre data-filename="manifest.json"> |
229 "permissions": ["storage", "alarms"<b>, "notifications"</b>], | 233 "permissions": ["storage", "alarms"<b>, "notifications"</b>], |
230 </pre> | 234 </pre> |
231 | 235 |
232 <h3 id="update-background-script-notifications">Update background scripts</h3> | 236 <h3 id="update-background-script-notifications">Update background scripts</h3> |
233 | 237 |
234 <p>In <strong><em>background.js</em></strong>, refactor the <code>chrome.app.win
dow.create()</code> callback into a standalone method so we can reuse it:</p> | 238 <p>In <strong><em>background.js</em></strong>, refactor the <code>chrome.app.win
dow.create()</code> callback into a standalone method so you can reuse it:</p> |
235 | 239 |
236 <pre data-filename="background.js"> | 240 <pre data-filename="background.js"> |
237 <strike>chrome.app.runtime.onLaunched.addListener(function() {</strike> | 241 <strike>chrome.app.runtime.onLaunched.addListener(function() {</strike> |
238 <b>function launch() {</b> | 242 <b>function launch() {</b> |
239 chrome.app.window.create('index.html', { | 243 chrome.app.window.create('index.html', { |
240 id: 'main', | 244 id: 'main', |
241 bounds: { width: 620, height: 500 } | 245 bounds: { width: 620, height: 500 } |
242 }); | 246 }); |
243 <b>}</b> | 247 <b>}</b> |
244 <strike>});</strike> | 248 <strike>});</strike> |
245 <b>chrome.app.runtime.onLaunched.addListener(launch);</b> | 249 <b>chrome.app.runtime.onLaunched.addListener(launch);</b> |
246 ... | 250 ... |
247 </pre> | 251 </pre> |
248 | 252 |
249 <h3 id="update-alarm-listener">Update alarm listener</h3> | 253 <h3 id="update-alarm-listener">Update alarm listener</h3> |
250 | 254 |
251 <p>At the top of the <em>background.js</em>, add a variable for a database name
that we'll use in our alarm listener:</p> | 255 <p>At the top of the <em>background.js</em>, add a variable for a database name
that's used in the alarm listener:</p> |
252 | 256 |
253 <pre data-filename="background.js"> | 257 <pre data-filename="background.js"> |
254 <b>var dbName = 'todos-vanillajs';</b> | 258 <b>var dbName = 'todos-vanillajs';</b> |
255 </pre> | 259 </pre> |
256 | 260 |
257 <p>The value of <code>dbName</code> is the same database name we set in line 17
of <em>js/app.js</em>:</p> | 261 <p>The value of <code>dbName</code> is the same database name set in line 17 of
<em>js/app.js</em>:</p> |
258 | 262 |
259 <pre data-filename="app.js"> | 263 <pre data-filename="app.js"> |
260 var todo = new Todo('todos-vanillajs'); | 264 var todo = new Todo('todos-vanillajs'); |
261 </pre> | 265 </pre> |
262 | 266 |
263 <h3 id="create-notification">Create a notification</h3> | 267 <h3 id="create-notification">Create a notification</h3> |
264 | 268 |
265 <p>Instead of simply logging a new alarm to the Console, update the <code>onAlar
m</code> listener | 269 <p>Instead of simply logging a new alarm to the Console, update the <code>onAlar
m</code> listener |
266 to get stored data via <code>chrome.storage.local.get()</code> and call a <code>
showNotification()</code> | 270 to get stored data via <code>chrome.storage.local.get()</code> and |
267 method that we'll make in the following step:</p> | 271 call a <code>showNotification()</code> method:</p> |
268 | 272 |
269 <pre data-filename="background.js"> | 273 <pre data-filename="background.js"> |
270 chrome.alarms.onAlarm.addListener(function( alarm ) { | 274 chrome.alarms.onAlarm.addListener(function( alarm ) { |
271 <strike>console.log("Got an alarm!", alarm);</strike> | 275 <strike>console.log("Got an alarm!", alarm);</strike> |
272 <b>chrome.storage.local.get(dbName, showNotification);</b> | 276 <b>chrome.storage.local.get(dbName, showNotification);</b> |
273 }); | 277 }); |
274 </pre> | 278 </pre> |
275 | 279 |
276 <p>Add this <code>showNotification()</code> method to <em>background.js</em>:</p
> | 280 <p>Add this <code>showNotification()</code> method to <em>background.js</em>:</p
> |
277 | 281 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 <h3 id="interact-with-notification">Handle notification interactions</h3> | 323 <h3 id="interact-with-notification">Handle notification interactions</h3> |
320 | 324 |
321 <p>Open the Todo app when the user clicks on the notification. At the end of <em
>background.js</em>, create a <a href="/apps/notifications#event-onClicked"><cod
e>chrome.notifications.onClicked</code></a> event handler:</p> | 325 <p>Open the Todo app when the user clicks on the notification. At the end of <em
>background.js</em>, create a <a href="/apps/notifications#event-onClicked"><cod
e>chrome.notifications.onClicked</code></a> event handler:</p> |
322 | 326 |
323 <pre data-filename="background.js"> | 327 <pre data-filename="background.js"> |
324 <b>chrome.notifications.onClicked.addListener(function() { | 328 <b>chrome.notifications.onClicked.addListener(function() { |
325 launch(); | 329 launch(); |
326 });</b> | 330 });</b> |
327 </pre> | 331 </pre> |
328 | 332 |
329 <p>The event handler callback simply calls the <code>launch()</code> method that
we refactored earlier. <code>chrome.app.window.create()</code> will either crea
te a new Chrome App window if one doesn't already exist, or bring into focus the
currently open window that has the window id of <code>main</code>.</p> | 333 <p>The event handler callback simply calls the <code>launch()</code> method. |
330 | 334 <code>chrome.app.window.create()</code> either creates a new Chrome App window |
331 <!-- <h3 id="clear-notification">Clear the notification</h3> | 335 if one doesn't already exist, |
332 | 336 or brings into focus the currently open window |
333 <p style="color: red;">You might notice that the notification popup does not go
away after we click on it. The <code>onClicked</code> event handler callback pas
ses along the id name of the popup that was interacted with. Use that, in combin
ation with <a href=""><code>chrome.notifications.clear()</code></a>, to dismiss
the notification:</p> | 337 that has the window id of <code>main</code>.</p> |
334 | |
335 <pre data-filename="background.js"> | |
336 chrome.notifications.onClicked.addListener( | |
337 function(<b> notificationId </b>) { | |
338 launch(); | |
339 <b>chrome.notifications.clear(notificationId, function() {});</b> | |
340 } | |
341 ); | |
342 </pre> --> | |
343 | |
344 <!-- <h3 id="rich-notifications">Learn more about rich notifications</h3> | |
345 | |
346 <p>For additional information about notifications, refer to <a href="/apps/deskt
op_notifications">Rich Notifications</a> in the docs.</p> --> | |
347 | 338 |
348 <h2 id="launch">Launch your finished Todo app</h2> | 339 <h2 id="launch">Launch your finished Todo app</h2> |
349 | 340 |
350 <p>You are done Step 3! Reload your app and you should now have a Todo app with
reminders.</p> | 341 <p>You are done Step 3! Reload your Todo app now with reminders.</p> |
351 | 342 |
352 <figure> | 343 <figure> |
353 <img src="{{static}}/images/app_codelab/step3-completed.gif" alt="The Todo app
with notifications"/> | 344 <img src="{{static}}/images/app_codelab/step3-completed.gif" alt="The Todo app
with notifications"/> |
354 </figure> | 345 </figure> |
355 | 346 |
356 <p>You should notice that:</p> | 347 <p>Check these behaviors work as expected:</p> |
357 | 348 |
358 <ul> | 349 <ul> |
359 <li>If you don't have any uncompleted todo items, there are no popup notificat
ions.</li> | 350 <li>If you don't have any uncompleted todo items, there are no popup notificat
ions.</li> |
360 <li>If you click on the notification when your app is closed, the Todo app wil
l | 351 <li>If you click on the notification when your app is closed, the Todo app wil
l |
361 open or come into focus.</li> | 352 open or come into focus.</li> |
362 </ul> | 353 </ul> |
363 | 354 |
364 <h3 id="troubleshooting">Troubleshooting</h3> | 355 <h3 id="troubleshooting">Troubleshooting</h3> |
365 | 356 |
366 <p>Your final <em>background.js</em> file should look like | 357 <p>Your final <em>background.js</em> file should look like |
367 <a href="https://github.com/mangini/io13-codelab/blob/master/cheat_code/solution
_for_step3/background.js">this</a>. If notifications are not showing up, confirm
that your Chrome is version 28 or | 358 <a href="https://github.com/mangini/io13-codelab/blob/master/cheat_code/solution
_for_step3/background.js">this</a>. If notifications are not showing up, confirm
that your Chrome is version 28 or |
368 higher. If notifications still don't show up, check for error messages in the | 359 higher. If notifications still don't show up, check for error messages in the |
369 DevTools Console on both the main window (<strong>right click > Inspect Element<
/strong>) and the | 360 DevTools Console on both the main window (<strong>right click > Inspect Element<
/strong>) and the |
370 background page (<strong>right click > Inspect Background Page</strong>).</p> | 361 background page (<strong>right click > Inspect Background Page</strong>).</p> |
371 | 362 |
372 <h2 id="recap">Recap APIs referenced in this step</h2> | 363 <h2 id="recap">For more information</h2> |
373 | 364 |
374 <p>For more detailed information about some of the APIs introduced in this step,
refer to:</p> | 365 <p>For more detailed information about some of the APIs introduced in this step,
refer to:</p> |
375 | 366 |
376 <ul> | 367 <ul> |
377 <li> | 368 <li> |
378 <a href="/apps/declare_permissions" title="Read 'Declare Permissions' in the
Chrome developer docs">Declare Permissions</a> | 369 <a href="/apps/declare_permissions" title="Read 'Declare Permissions' in the
Chrome developer docs">Declare Permissions</a> |
379 <a href="#update-permissions-alarms" class="anchor-link-icon" title="This fe
ature mentioned in 'Update app permissions for alarms'">↑</a> <a href="#up
date-permissions-notifications" class="anchor-link-icon" title="This feature men
tioned in 'Update app permissions for notifications'">↑</a> | 370 <a href="#update-permissions-alarms" class="anchor-link-icon" title="This fe
ature mentioned in 'Update app permissions for alarms'">↑</a> |
380 </li> | 371 </li> |
381 <li> | 372 <li> |
382 <a href="/apps/alarms.html" title="Read 'chrome.alarms' in the Chrome develo
per docs">chrome.alarms</a> | 373 <a href="/apps/alarms.html" title="Read 'chrome.alarms' in the Chrome develo
per docs">chrome.alarms</a> |
383 <a href="#alarms" class="anchor-link-icon" title="This feature mentioned in
'Add alarm reminders'">↑</a> | 374 <a href="#alarms" class="anchor-link-icon" title="This feature mentioned in
'Add alarm reminders'">↑</a> |
384 </li> | 375 </li> |
385 <li> | 376 <li> |
386 <a href="/apps/alarms#event-onAlarm" title="Read 'chrome.alarms.onAlarm' in
the Chrome developer docs">chrome.alarms.onAlarm</a> | 377 <a href="/apps/alarms#event-onAlarm" title="Read 'chrome.alarms.onAlarm' in
the Chrome developer docs">chrome.alarms.onAlarm</a> |
387 <a href="#update-background-script-alarms" class="anchor-link-icon" title="T
his feature mentioned in ''">↑</a> | 378 <a href="#update-background-script-alarms" class="anchor-link-icon" title="T
his feature mentioned in ''">↑</a> |
388 </li> | 379 </li> |
389 <li> | 380 <li> |
(...skipping 28 matching lines...) Expand all Loading... |
418 <a href="/apps/notifications" title="Read 'chrome.notifications.clear()' in
the Chrome developer docs">chrome.notifications.clear()</a> | 409 <a href="/apps/notifications" title="Read 'chrome.notifications.clear()' in
the Chrome developer docs">chrome.notifications.clear()</a> |
419 <a href="#clear-notification" class="anchor-link-icon" title="This feature m
entioned in 'Clear the notification'">↑</a> | 410 <a href="#clear-notification" class="anchor-link-icon" title="This feature m
entioned in 'Clear the notification'">↑</a> |
420 </li> --> | 411 </li> --> |
421 <!-- <li> | 412 <!-- <li> |
422 <a href="/apps/desktop_notifications" title="Read 'Rich Notifications' in th
e Chrome developer docs">Rich Notifications</a> | 413 <a href="/apps/desktop_notifications" title="Read 'Rich Notifications' in th
e Chrome developer docs">Rich Notifications</a> |
423 <a href="#rich-notifications" class="anchor-link-icon" title="This feature m
entioned in 'Learn more about rich notifications'">↑</a> | 414 <a href="#rich-notifications" class="anchor-link-icon" title="This feature m
entioned in 'Learn more about rich notifications'">↑</a> |
424 </li> --> | 415 </li> --> |
425 </ul> | 416 </ul> |
426 | 417 |
427 <p>Ready to continue onto the next step? Go to <a href="app_codelab_webview.html
">Step 4 - Open external links with a webview »</a></p> | 418 <p>Ready to continue onto the next step? Go to <a href="app_codelab_webview.html
">Step 4 - Open external links with a webview »</a></p> |
OLD | NEW |