设备令牌是否会在Apple推送通知中发生变化 [英] Does device token ever change in Apple Push Notifications

查看:91
本文介绍了设备令牌是否会在Apple推送通知中发生变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个iOS应用程序,其中我实现了推送通知。
一切正常。
但是只想询问我的Apple设备的设备令牌是否会改变?

I am developing an iOS app in which i have implemented Push Notification. Everything is working fine. But just wish to ask if device Token for my Apple device will ever change??

我们还需要互联网连接来生成设备令牌。

Also do we need internet connectivity for generating device token.

谢谢

推荐答案

我的Apple设备的设备令牌将永远改变

- 是的。如果将备份数据还原到新设备或重新安装操作系统,则设备令牌会更改。所以我的建议是用令牌更新服务器

-- YES. If you restores backup data to a new device or reinstall the operating system, the device token changes. So my suggestion is to update the server with token

我们是否需要互联网连接来生成设备令牌

- 据我所知,是的。注册用户时,请调用推送通知的注册方法。成功注册时调用委托方法 -

-- as far as I know, YES. When you register user, you call method for registration for push notification. This on successful registration call the delegate method -

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

表示您已成功注册推送通知或其调用失败 -

indicating you are registered successfully for a push notification or on failure it calls -

- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error

表示无法注册通知。

您可以通过关闭网络并运行应用程序来检查它。

You can check it by turning off network and running your application.

这篇关于设备令牌是否会在Apple推送通知中发生变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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