如何使用 InstanceID 从服务器端发送通知? - 带有 .NET 服务器的 GCM
how to use InstanceID to send notification from Server Side ? - GCM with .NET server
我使用 GCM 将通知消息从我的服务器推送到 Android 和 iOS 设备。
目前我正在使用 PushSharp 以这种方式使用的库:
string senderId = "my server id from google console";
string device_regId = "some device id";
//Create our push services broker
var push = new PushBroker();
//Registering the GCM Service and sending an Android Notification
push.RegisterGcmService(new GcmPushChannelSettings(senderId));
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId(device_regId)
.WithJson("{\"message\":\"TestMessage!\",\"badge\":1}"));
我已阅读 google InsanceID Documentation,
问题:
1- How to use it on server side?
2- what would change in my current implementation?
3- Is there any example of how to use InsanceID instead of RegisterationId which is used previously and has been deprecated now ?
简而言之,在服务器端,您可以像对待 RegistrationIds 一样对待 InstanceIds,InstanceIds 可能比 RegistrationIds 更频繁地更改,但这应该不会影响您的服务器,因为 RegistrationIds 也发生了变化。
1- How to use it on server side?
当使用 InstanceId 而不是 RegistrationId 时,服务器端应该没有变化。
2- what would change in my current implementation?
我不是一个敏锐的专家,但我认为这里也不需要更改任何内容。 InstanceId 是与 RegistrationId 相同的应用程序实例标识符。
Is there any example of how to use InsanceId instead of RegisterationId which is used previously and has been deprecated now ?
Here is an example in java 其中 to 字段设置为 InstanceId(如果存在)。我假设 push sharp 正在做类似的事情。
我使用 GCM 将通知消息从我的服务器推送到 Android 和 iOS 设备。
目前我正在使用 PushSharp 以这种方式使用的库:
string senderId = "my server id from google console";
string device_regId = "some device id";
//Create our push services broker
var push = new PushBroker();
//Registering the GCM Service and sending an Android Notification
push.RegisterGcmService(new GcmPushChannelSettings(senderId));
push.QueueNotification(new GcmNotification().ForDeviceRegistrationId(device_regId)
.WithJson("{\"message\":\"TestMessage!\",\"badge\":1}"));
我已阅读 google InsanceID Documentation,
问题:
1- How to use it on server side?
2- what would change in my current implementation?
3- Is there any example of how to use InsanceID instead of RegisterationId which is used previously and has been deprecated now ?
简而言之,在服务器端,您可以像对待 RegistrationIds 一样对待 InstanceIds,InstanceIds 可能比 RegistrationIds 更频繁地更改,但这应该不会影响您的服务器,因为 RegistrationIds 也发生了变化。
1- How to use it on server side?
当使用 InstanceId 而不是 RegistrationId 时,服务器端应该没有变化。
2- what would change in my current implementation?
我不是一个敏锐的专家,但我认为这里也不需要更改任何内容。 InstanceId 是与 RegistrationId 相同的应用程序实例标识符。
Is there any example of how to use InsanceId instead of RegisterationId which is used previously and has been deprecated now ?
Here is an example in java 其中 to 字段设置为 InstanceId(如果存在)。我假设 push sharp 正在做类似的事情。