为Android PushSharp设备ID [英] PushSharp Device ID for Android
问题描述
所有,
我可能会问一个很基本的问题在这里,但怎么开始你的设备ID为PushSharp Android中?我的设置是VB.net,我们将要发送给大量不同的Android设备。
这里继PushSharp例子是我的code迄今:
I'm probably asking a very basic question here, but how does one get your device ID for PushSharp in Android? My setup is VB.net, and we'll be sending to a large number of different Android devices. Following the PushSharp example here is my code so far:
push.RegisterGcmService(new
GcmPushChannelSettings("YOUR Google API's Console API Access API KEY for Server Apps HERE"));
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId(
"DEVICE REGISTRATION ID HERE")
.WithJson("{\"alert\":\"Hello World!\",
\"badge\":7,\"sound\":\"sound.caf\"}"));
我知道API密钥是从GCM服务,但哪里设备注册ID从何而来?是建立在GCM服务?或者是,东西Android设备向服务器发送要救?
I know the API key is from the GCM service, but where does the Device Registration ID come from? Is that setup by the GCM service? Or is that something the android device sends the server should save?
感谢您的帮助。
推荐答案
的注册ID被GCM服务分配。当应用程序注册到GCM,它得到一个注册ID,应当将其发送给服务器。
The registration ID is assigned by the GCM service. When the application registers to GCM, it gets a registration ID and should send it to the server.
注册ID 由GCM服务器发出来的Android应用程序,允许其接收消息的ID。一旦Android应用具有的注册ID,将其发送给第三方应用服务器,它使用它来识别每个已注册接收消息对于一个给定的Android施用装置。换言之,一个注册ID依赖于特定的设备上运行的特定Android应用程序。
Registration 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.
您可以阅读更多关于它这里。
You can read more about it here.
这篇关于为Android PushSharp设备ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!