全部,
我可能在这里问了一个非常基本的问题,但是如何在 Android 中获取 PushSharp 的设备 ID?我的设置是 VB.net,我们将发送到大量不同的 Android 设备。到目前为止,在 PushSharp 示例之后是我的代码:
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设备发送给服务器的东西应该保存?
谢谢您的帮助。