什么是回调方法,如果您按一下[不允许"在推送通知弹出? [英] What is the Callback Method if You Click "Don't Allow" in Push Notification Popup?

查看:193
本文介绍了什么是回调方法,如果您按一下[不允许"在推送通知弹出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有这么新鲜的安装应用程序会出现一个推送通知弹出。有两种选择,确定,不允许(如果我没记错的话)。

There's a push notification popup that appears on fresh install of app. There are two choices, OK and Don't Allow (if i remember it correctly.)

我想知道什么是回调方法,如果我点击不允许。关键是,我实现了didFailToRegisterForRemoteNotifications,因为我想,如果我点击不允许它会直接进入到AppDelegate中这种方法。然而,该方法并没有被调用。

I want to know what's the call back method if I click "Don't Allow". The thing is, I implemented didFailToRegisterForRemoteNotifications because I thought that if I click "Don't Allow" it would go straight to that method in AppDelegate. However, the method wasn't called.

我的问题是我需要知道的事件,当用户点击不允许。有没有办法做到这一点?
我倒是AP preciate任何帮助。谢谢你。

My problem is I need to know the event when user clicks on "Don't Allow". Is there a way to do this? I'd appreciate any help. Thanks.

推荐答案

有没有委托回调不过从这里开始:<一href=\"http://stackoverflow.com/questions/19053092/callback-method-if-user-declines-push-notification-prompt\">Callback方法,如果用户拒绝推送通知提示?

There is no delegate callback however from here:Callback Method if user declines Push Notification Prompt?

您可以有一个布尔变量来检查它在你的AppDelegate,

You can have a BOOL variable to check it in your AppDelegate,

AppDelegate.m

// declare a BOOL 
BOOL allow = NO;

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
  allow = YES;
  [self doWhatever];
}

- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
  allow = YES;
  [self doWhatever];
}

这篇关于什么是回调方法,如果您按一下[不允许&QUOT;在推送通知弹出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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