gpt4 book ai didi

Android GCM : Is intent. getStringExtra(EXTRA_REGISTRATION_ID) 对于每个设备都是唯一的?

转载 作者:行者123 更新时间:2023-11-29 21:54:29 25 4
gpt4 key购买 nike

我很好奇从 GCM 类 GCMBaseIntentService 的 intent.getStringExtra(EXTRA_REGISTRATION_ID) 生成的字符串对于每个 Android 设备是否都是唯一的?它是如何产生的?

最佳答案

注册 ID 由 GCM 服务器创建,对于在特定设备上运行的特定应用程序是唯一的。

您可以在此处阅读更多信息:http://developer.android.com/guide/google/gcm/gs.html#android-app

onRegistered(Context context, String regId): Called after a registration intent is received passes the registration ID assigned by GCM to that device/application pair as parameter. Typically, you should send the regid to your server so it can use it to send messages to this device.

这里:http://developer.android.com/guide/google/gcm/gcm.html#arch

注册ID

An ID issued by the GCM servers to the Android application that allows it to receive messages. Once the Android application has the registration ID, it sends it to the 3rd-party application server, which uses it to identify each device that has registered to receive messages for a given Android application. In other words, a registration ID is tied to a particular Android application running on a particular device.

此外,该字符串不是由您引用的代码生成的,而是在 GCM 服务器上生成的,并由该代码从 Intent 中读取。

关于Android GCM : Is intent. getStringExtra(EXTRA_REGISTRATION_ID) 对于每个设备都是唯一的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13580338/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com