我可以在我的应用程序接收GCM的消息从两个或多个GCM SENDER_ID? [英] Can I receive GCM messages from two or more GCM SENDER_ID in my app?

查看:185
本文介绍了我可以在我的应用程序接收GCM的消息从两个或多个GCM SENDER_ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要接收来自不同的发送者推送通知我的应用程序。将它的工作?

I need to receive push notifications from different senders in my app. Will it work?

推荐答案

回答你的问题的的!

据GCM的官方文档的应用程序可以接收来自多个发件人的邮件(仅限于100种不同的发送者)和你的意图code应该像上面的一个正常工作。

According to GCM's official documentation your app can receive messages from multiple senders (limited to 100 different senders) and your intent code should look like the above one to work correctly.

Intent intent = new Intent(GCMConstants.INTENT_TO_GCM_REGISTRATION);
intent.setPackage(GSF_PACKAGE);
intent.putExtra(GCMConstants.EXTRA_APPLICATION_PENDING_INTENT,
        PendingIntent.getBroadcast(context, 0, new Intent(), 0));
String senderIds = "968350041068,652183961211";
intent.putExtra(GCMConstants.EXTRA_SENDER, senderIds);
ontext.startService(intent);

随时查看多个发件人在GCM页面官方主题

这篇关于我可以在我的应用程序接收GCM的消息从两个或多个GCM SENDER_ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆