简体   繁体   English

sendMessage IBM Bluemix PushNotification Rest API正在取消注册设备

[英]sendMessage IBM Bluemix PushNotification Rest API is unregistering the device

I am using IBM Bluemix Rest APIs for Push Notifcation with Spring Boot 1.5.6.RELEASE and Java 1.8. 我正在将IBM Bluemix Rest API与Spring Boot 1.5.6.RELEASE和Java 1.8一起用于推送通知。 I am using RestTemplate for invoking the below APIs from Java Code. 我正在使用RestTemplate从Java代码调用以下API。 I am sending push notifications to ios devices registered to APNS (Apple Push Notification service). 我正在向注册到APNS的ios设备发送推送通知(Apple推送通知服务)。

I am binding the push notification service to my java app on BlueMix and getting the url, clientSecret, and appSecret from VCAP_SERVICES. 我将推送通知服务绑定到BlueMix上的Java应用程序,并从VCAP_SERVICES获取url,clientSecret和appSecret。

I am noticing a weird behavior and was wondering if anyone else has also experienced the same. 我注意到一种奇怪的行为,并且想知道是否还有其他人也经历过同样的事情。

Please refer to the below steps: 请参考以下步骤:

  1. I am registering a device using "registerDevice" POST API. 我正在使用“ registerDevice” POST API注册设备。 The endpoint for which is " http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices ". 端点为“ http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices ”。
  2. I verify that the device is registered successfully using "getDevices" GET API. 我使用“ getDevices” GET API验证设备已成功注册。 The endpoint for which is " http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices ". 端点为“ http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/devices ”。
  3. I then send a push noification using "sendMessage" POST API. 然后,我使用“ sendMessage” POST API发送推送通知。 The endpoint for which is " http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/messages ". 端点为“ http://imfpush.xxxxxxxx.xxxx.bluemix.net/imfpush/v1/apps/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/messages ”。

The weird behavior I am noticing is after invoking the sendMessage POST API, the device which I registered in step 1 is no longer registered. 我注意到的怪异行为是在调用sendMessage POST API之后,我在步骤1中注册的设备不再注册。 After step3 above if I go back to step 2 and invoke the "getDevices" API again, the device is no longer registered. 在上面的步骤3之后,如果我返回到步骤2并再次调用“ getDevices” API,则该设备不再注册。 It returns below response: 返回以下响应:

{ "pageInfo": { "totalCount": 0, "count": 0 }, "devices": [] } {“ pageInfo”:{“ totalCount”:0,“ count”:0},“ devices”:[]}

Is this a bug in "sendMessage" POST API? 这是“ sendMessage” POST API中的错误吗?

Please help 请帮忙

Thanks in advance 提前致谢

The de-registration of the device is due to an invalid or inactive token for that registered device. 取消注册是由于该注册设备的令牌无效或无效。 Bluemix is deleting the registration because APNs/GCM is responding that the device's token is invalid when a push is attempted against it. Bluemix正在删除注册,因为尝试对其进行推送时,APNs / GCM正在响应该设备的令牌无效。 Can you please make sure to configure valid credentials for APNS/GCM.. Follow the steps from the doc to Obtain your notification provider credentials 您能确保为APNS / GCM配置有效的凭据吗?请按照文档中的步骤操作以获取通知提供者凭据

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM