1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 namespace pushMessaging
{
8 // The subchannel the message was sent on;
9 // only values 0-3 are valid.
12 // The payload associated with the message, if any.
16 dictionary ChannelIdResult
{
17 // The channel ID for this app to use for push messaging.
21 callback ChannelIdCallback
= void (ChannelIdResult channelId
);
24 // Retrieves the channel ID associated with this app or extension.
25 // Typically an app or extension will want to send this value
26 // to its application server so the server can use it
27 // to trigger push messages back to the app or extension.
28 // If the interactive flag is set, we will ask the user to log in
29 // when they are not already logged in.
30 static
void getChannelId
(optional boolean interactive
,
31 ChannelIdCallback
callback);
35 // Fired when a push message has been received.
36 // |message| : The details associated with the message.
37 static
void onMessage
(Message message);