我使用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文档上读过,
问题
如何在服务器端使用它? 2-我目前的执行情况将发生什么变化? 3-是否有任何例子说明如何使用InsanceID而不是以前使用的RegisterationId,而后者现在已经被弃用了?
发布于 2015-10-18 15:34:43
总之,在服务器端,您可以像对待InstanceIds一样对待RegistrationIds,InstanceIds可能比RegistrationIds更频繁地更改,但这不应该影响您的服务器,因为RegistrationIds也发生了变化。
如何在服务器端使用它?
当使用InstanceId而不是RegistrationId时,服务器端不应该有任何更改。
2-我目前的执行情况将发生什么变化?
我不是一个推尖的专家,但我不认为任何东西将需要改变这里。InstanceId是与RegistrationId相同的应用程序实例标识符。
是否有任何示例说明如何使用InsanceId而不是以前使用的、现在已被废弃的RegisterationId?
下面是java中的一个示例,其中如果存在to字段,则将其设置为InstanceId。我假设那个推尖是在做类似的事情。
https://stackoverflow.com/questions/33184473
复制相似问题