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.
11 // The payload associated with the message, if any.
15 dictionary ChannelIdResult
{
16 // The channel ID for this app to use for push messaging.
20 callback ChannelIdCallback
= void (ChannelIdResult channelId
);
23 // Retrieves the channel ID associated with this app or extension.
24 // Typically an app or extension will want to send this value
25 // to its application server so the server can use it
26 // to trigger push messages back to the app or extension.
27 // If the interactive flag is set, we will ask the user to log in
28 // when they are not already logged in.
29 static
void getChannelId
(optional boolean interactive
,
30 ChannelIdCallback
callback);
34 // Fired when a push message has been received.
35 // |message| : The details associated with the message.
36 static
void onMessage
(Message message);