Android GCM服务器错误:设备订阅已过期 [英] Android GCM Server error: Device Subscription Expired

查看:176
本文介绍了Android GCM服务器错误:设备订阅已过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过GCM向Android设备发送通知时,我收到以下回复:

设备订阅已过期:PushSharp.Android.GcmPushService - > AppId



由于这个问题,我在手机上遇到了随机问题。例如,该应用程序在接收器上接收额外的回叫。

有人可以提供有关此错误的更多详细信息吗?它什么时候发生?它是否与设备ID注册类似?需要做些什么来处理这种情况?

谢谢!

解决方案

如果您查看 GcmPushChannel.cs ,当Google返回 NotRegistered 错误或<$ c $>时,您会看到 DeviceSubscriptonExpiredException c> CanonicalRegistrationId 。



既然你说你的应用程序在接收器上有额外的调用,那么你有可能在你的数据库中有多个注册ID对于同一台设备,当您向所有设备发送消息时,设备会获取多条消息。这可以解释为什么您在Google的回复中获得了注册ID。



我不确定Push Sharp如何处理Canonical注册ID。从我阅读的小代码可能会触发一个事件,允许您从数据库中删除旧的注册ID。

On sending notifications to an Android device via GCM I am getting the following response:

Device Subscription Expired: PushSharp.Android.GcmPushService -> AppId

Due to this issue I experience random issues on the phone. For example, the app receives extra call backs on the receiver.

Can someone please provide more details about this error? When does it occur? Is it similar to device id registration? What needs to be done to handle this situation?

Thanks!

解决方案

If you look at the code of GcmPushChannel.cs, you'll see that DeviceSubscriptonExpiredException is returned when either Google return NotRegistered error or a CanonicalRegistrationId.

Since you are saying your app gets extra calls on the receiver, it's possible that you have in your DB multiple registration IDs for the same device, and when you send a message to all of them, your device gets multiple messages. This would explain why you get a canonical registration ID in your response from Google.

I'm not sure how Push Sharp handles Canonical Registration ID. From the little code I read it's possible that it fires an event that allows you to delete the old registration ID from your DB.

这篇关于Android GCM服务器错误:设备订阅已过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆