捕获的答案"应用程序想向您发送推送通知"警报 [英] Capture answer to "App would like to send you push notifications" alert

查看:364
本文介绍了捕获的答案"应用程序想向您发送推送通知"警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次调用 registerForRemoteNotificationTypes:你的的UIApplication 对象, A UIAlertView中弹出说[应用]想向您发送推送通知。

The first time you call registerForRemoteNotificationTypes: on your UIApplication object, a UIAlertView pops up saying "[app] would like to send you push notifications".

有没有办法知道OK或者不允许在这个被窃听 AlertView

Is there any way to know when "OK" or "Don't allow" is tapped in this AlertView?

目前应用程序:didRegisterForRemoteNotificationsWithDeviceToken:叫上我的的AppDelegate ,用户作出决定之前也

Currently application:didRegisterForRemoteNotificationsWithDeviceToken: is called on my AppDelegate, even before a user makes a decision.

我想问的原因是因为在第一次发射,我想推的ViewController 通知选项,但只有当用户表示,他们希望收到通知。

The reason I ask is because on first launch, I want to push a ViewController with Notification options, but only if the user indicated that they want to receive notifications.

推荐答案

您可以使用下一个方法的UIApplication

You can use next method of UIApplication:

返回的通知类型的应用程序接受的。

- (UIRemoteNotificationType)enabledRemoteNotificationTypes

例如,

UIRemoteNotificationType status = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (status == UIRemoteNotificationTypeNone)
{
     NSLog(@"user is not subscribed to receive push notifications");
}

这篇关于捕获的答案"应用程序想向您发送推送通知"警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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