| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| [DartPackage="sky_services"] |
| module gcm; |
| |
| [ServiceName="gcm::GcmListener"] |
| interface GcmListener { |
| OnMessageReceived(string from, string jsonMessage); |
| }; |
| |
| [ServiceName="gcm::GcmService"] |
| interface GcmService { |
| // senderId is the project_number from google-services.json. |
| // token should be saved and remembered - you only need to register your app |
| // once. I don't understand how this token is used, though. |
| Register(string senderId, GcmListener listener) => (string token); |
| SubscribeTopics(string token, array<string> topics); |
| UnsubscribeTopics(string token, array<string> topics); |
| }; |