Can i use one GCM project number in two different app for receive Push of GCM?

前提是你 提交于 2019-12-24 12:35:02

问题


We have two different application but both required same push notification from Google Cloud Messages and i have use only one sender id (Project No of Enable one of Google Console )in both app .

Do this will create any issue because i am getting two push for same message in my one of the application.


回答1:


Simply restrict your notification by package name:

Sender sender = new Sender(KEY);
GCMessage msg = new GCMessage.Builder().
restrictedPackageName(GC_PACKAGE_NAME).build();


来源:https://stackoverflow.com/questions/26757064/can-i-use-one-gcm-project-number-in-two-different-app-for-receive-push-of-gcm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!