简体   繁体   English

是否有机会针对GCM中的两个不同应用程序使用相同的令牌? [Android]产品

[英]Is there any chance to use the same token for two different applications in GCM? [Android]

I'd like to know if two applications installed in the same device could share the same token for GCM taking in to account that they will receive messages from the same server. 我想知道安装在同一设备上的两个应用程序是否可以为GCM共享相同的令牌,同时考虑到它们将接收来自同一服务器的消息。

在此处输入图片说明

Thanks a lot 非常感谢

No, it's not possible. 不,不可能。 Each application has to register separately to GCM, and will receive a different registration token from GCM. 每个申请都必须分别向GCM注册,并且将从GCM接收不同的注册令牌。

Anyway, it doesn't make much sense (at least not to me) to send the same GCM message to two applications on the same device. 无论如何,将相同的GCM消息发送到同一设备上的两个应用程序没有多大意义(至少对我而言)。

  • First of all you will not be able to install one application with same package name (com.org.app) in once device. 首先,您将无法在一个设备中安装一个具有相同软件包名称(com.org.app)的应用程序。
  • Secondly: When GCM creates token on based of the created application, it makes sure to take input as 其次:当GCM根据创建的应用程序创建令牌时,请确保将输入作为
    1) SHA1 Keystore 1)SHA1密钥库
    2) Package Name 2)包裹名称
  • If SHA1 is same and package name is different, then different API keys should be generated from developer console 如果SHA1相同且程序包名称不同,则应从开发人员控制台生成不同的API密钥

  • So to conclude, you will need to create different API key from developer.console.com by adding multiple API key in same project 因此,总而言之,您需要通过在同一项目中添加多个API密钥来从developer.console.com创建不同的API密钥
  • Or create totally different project and create API key with new application package name 或创建完全不同的项目并使用新的应用程序包名称创建API密钥


在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android中两个应用程序的相同GCM注册ID? - same GCM Registration id for two applications in android? 在两个应用程序中相同的GCM消息 - Same GCM message in two applications 运行不同应用程序的两个 Android 设备可以使用相同的 SQLite 数据库吗? - Can two Android devices, running different applications, use the same SQLite Database? 运行在不同机器上的两个应用程序可以使用同一个数据库吗? - Can two applications running on different machines use the same database? 我可以使用同一个密钥库文件来签署两个不同的应用程序吗? - Can I use the same keystore file to sign two different applications? 我需要制作2个不同的应用程序才能在Android中使用GCM吗? - Do I need to make 2 different applications for using GCM in android? 是否可以使用GCM在不同的应用程序之间发送推送通知? - Is it possible to use GCM to send push notifications between different applications? 仅使用GCM来为Android放弃XMPP开发聊天应用程序好吗? - Is it good to use only GCM for developing chat applications for android ditching XMPP? Android - 没有获得GCM令牌 - Android - not getting GCM token 如何在 Android 中使用相同的 Edittext 作为两个不同的? - How to use same Edittext as two different in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM