如何显示“想要发送推送通知”警报再次查看? [英] How to show "Would like to send you Push Notifications" Alert View again?

查看:116
本文介绍了如何显示“想要发送推送通知”警报再次查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当时注册远程通知后,能够显示如上图所示的警报视图。
但是当我删除我的项目应用程序并再次构建它时,它将不再显示。

I was able to show an Alert View like the image above after registering for Remote Notifications. But when i delete my Project App and build it again, it will not show anymore.

是否有机会再次显示警报视图相同的设备?

Will there be any chances to show the alert view again to the same device?

我喜欢的是再次获取我的设备令牌,因为我未能将设备令牌暂时存储在NSUserDefaults中。

What i like is to get my device token again because I failed to store the device token temporarily in the NSUserDefaults.

推荐答案

启动时,您的应用应通过以下方式请求令牌:

At launch, your app should be requesting a token via:

- (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types

并将从iOS获取一个令牌委托消息:

and will get a token from iOS in the delegate message:

– application:didRegisterForRemoteNotificationsWithDeviceToken:

iOS将提示用户仅在必要时允许通知。如果已经为您的应用授权远程通知,则不会显示警报,您的应用将获得有效令牌。

iOS will prompt the user to allow notifications only when necessary. If remote notifications are already authorized for your app the alert will not appear and your app will get a valid token.

网络是您无法强制提醒但是您不能不需要。

Net is you can't force the alert but you don't need to.

这篇关于如何显示“想要发送推送通知”警报再次查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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