问题标签 [google-cloud-messaging]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
12 回答
22321 浏览

android - Android GCM : GCMRegistrar gives empty registration ID

I have followed http://developer.android.com/guide/google/gcm/gs.html#server-app to implement GCM in my application

that returns empty string as registration ID what else is needed to get the registration ID??

0 投票
2 回答
4402 浏览

android - isRegistered() 与 isRegisteredOnServer()

isRegisteredOnServer()

检查设备是否在服务器端注册成功

新的 GCM 会isRegisteredOnServer()检查应用程序是在 GCM 上还是在 3rd 方服务器上注册的?isRegistered()和 和有什么不一样isRegisteredOnServer()

如果isRegisteredOnServer()在第三方服务器中检查,在第三方服务器中将如何处理?第三方服务器是否也有任何特定的功能要实现?

0 投票
1 回答
1134 浏览

android - Android GCM Registration with more information

I implemented GCM to my app as described Getting Started page and used gcm.jar and gcm-server.jar helper libraries for easier implementation.

But I think I misunderstood something with GCM; beucase I couldn't achieve what i want.

I want that register devices with another key information not only registerId. For example this is a weather application and user may want to get notifications about one city or more cities. To achieve this, server needs the city name or postal code to fetch weather information from other sources and push back to the registered devices if there is any change at releated cities.

I register device when user stated to get notifications about something particular (for example city).

However GCMRegistrar.register method only takes 2 arguments, one for context and one for senderID.

How can I send additional parameters to application server?

edit: I implemented GCMIntentService and onRegistered method. I can send additional information from here with directly calling server; but i lose additional information when onRegistered method called.

0 投票
7 回答
5098 浏览

android - 谷歌云消息安全

公司创建一个项目并收到一个发件人 ID。公司创建一个应用程序,输入其发件人 ID 并将该应用程序放置在商店中。

攻击者对应用程序进行反向工程并提取发送者 ID 和用于接收 GCM 注册 ID 的服务器接口。

攻击者创建自己的应用程序,烘焙公司的发件人 ID 和服务器注册界面,将应用程序放入商店。就 GCM 而言,攻击应用程序基本上模仿了 Company 的真实应用程序:它注册以接收来自 Company 的发件人 ID 的消息,然后将其 GCM 注册 ID 发送到 Company 的服务器,就像“真实”应用程序一样。

现在公司想要向其应用程序的所有实例广播一些信息。也许这是一个提醒,而不是可用的更新。有什么方法可以区分“攻击应用程序”(与真实应用程序一样注册)与公司应用程序的“真实”版本?

0 投票
1 回答
755 浏览

android - 将 android 游戏链接到也玩的 facebook 朋友

我正在尝试为 Android 平台创建一个纸牌游戏,该游戏将通过网络进行,一次一回合。我希望在我的服务器后端使用 Google App Engine,并在轮到玩家时使用 Google Cloud Messaging 通知玩家。我的想法是让用户通过 Facebook API 登录,存储 facebook 用户 ID,然后使用 Google Cloud Messaging 注册应用程序并存储注册 ID。然后 facebook 和 GCM id 都将提交到服务器并存储在 GAE 数据存储中。要生成一个朋友列表来开始一个新游戏,我是否只需使用 facebook Open Graph API 来获取用户的朋友列表?ids,然后将存储在服务器上的每个 facebook id 与 facebook 好友列表进行比较?或者有没有更好的方法来获取也安装了该应用程序的 Facebook 朋友列表?

在每一回合之后,Android 应用程序会序列化一个“游戏”对象并将其上传到 GAE,然后 GAE 将使用保存的注册 id 通知其他玩家。当应用程序在设备上打开时,它会下载服务器上挂起的序列化“游戏”对象,然后对其进行充气并继续下一轮。这是我第一次尝试编写比使用一点 JavaScript 的简单网站更复杂的东西。任何帮助或方向将不胜感激。

0 投票
1 回答
1237 浏览

google-cloud-messaging - 谷歌云消息服务器 C#

我想向 GCM 发送消息,但收到状态为 200 的不可用。我做错了什么?

var GoogleAppID = ""; var DeviceID = "";

0 投票
1 回答
492 浏览

android - 使用 Android 的谷歌云消息 (GCM) 基础知识

我想使用 GCM 制作一个聊天应用程序。实际上我是使用 GCM 的新手。我已经阅读了 GCM 的官方文档。如果有人可以使用基本代码解释我,我需要知道如何通过服务器发送和接收数据。

0 投票
1 回答
2431 浏览

android - 使用 GCM 从 java 服务器向 android 手机发送希伯来语推送通知时出现乱码

我正在使用应用程序引擎使用 Google Cloud Messaging 将希伯来语推送通知发送到智能手机,但是当我在电话上收到消息时,文本是 ??????? 而不是希伯来语。

这里是使用 JSON 对象准备将消息发送到电话的代码:

在发送消息之前,我检查了 JSON 对象是否包含正确的希伯来语文本。

这里是在手机上接收消息的代码:

现在的文字是??????????????????? 而不是希伯来语。任何建议将被认真考虑。

0 投票
4 回答
17559 浏览

android - 使用 Google Cloud Messaging 在 Android 上进行即时通讯

我只是在查看新的 Google Cloud Messaging (GCM),我想知道是否可以在您的 Android 应用程序上使用 GCM 进行即时消息传递?

我看到您可以从服务器发送数据(例如消息),但也可以从一台设备发送到另一台设备吗?这将如何运作?一些示例代码将非常有帮助..

天呐!

0 投票
2 回答
177 浏览

android - 如何捕捉 C2DM 通知来电话?

启用 Android 的手机是否可以拦截所有 C2DM 通知?如果是这样,应该挖哪条路。