iOS - 要求在初始拒绝后启用推送通知 [英] iOS - Ask to enable push notifications after initial decline

查看:31
本文介绍了iOS - 要求在初始拒绝后启用推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在最初拒绝后从应用内强制弹出XXXXX 想向您发送推送通知".用例如下:

I would like to know if it's possible to force the "XXXXX would like to send you push notifications" popup from within an app, after an initial decline. The use case is as follows:

  • 用户安装应用程序,收到有关推送通知的警报,并拒绝,因为他们还不了解/信任该应用.

  • The user installs the app, gets the alert about push notifications, and declines because they don't know/trust the app yet.

他们使用应用程序并在应用程序内主动请求提醒当某事发生时(例如他们想买的东西是已售罄,因此他们希望在有货时收到提醒).

They use the app and proactively request within the app to be alerted when something happens (say for example something they want to buy is sold out so they want to be alerted when it is back in stock).

所以现在用户已经要求应用程序通知他们一些事情特定但在操作系统上禁用了推送通知水平.

So now the user has asked the app to notify them about something specific but has push notifications disabled at the operating system level.

所以如果用户请求提醒,但我检测到他们拒绝了第一次运行时发出警报,我需要通知他们这一点并让他们转向推送通知以使警报生效.

So if the user requests an alert, but I detect that they declined alerts on first run, I need to notify them of this and have them turn push notifications on for the alert to work.

理想情况下,我想强制XXXX 想发送给你推送通知警报"此时(自他们第二次安装了应用程序).

Ideally, I would like to force the "XXXX would like to send you push notifications alert" at this point (a second time since they installed the app).

我想 b 计划是向他们展示我自己的信息,告诉他们必须进入他们的系统设置并手动将其重新打开以接收他们想要的警报.这远非理想.

I guess plan b would be to show them my own message telling them they have to go into their system settings and turn it back on manually in order to receive the alert they want. This is far from ideal.

任何帮助将不胜感激.谢谢.

Any help would be appreciated. Thanks.

推荐答案

您不能让 iOS 再次显示警报.这是一个更好的方法:

You can't make iOS show the alert again. Here's a better approach:

  1. 在您的 NSUserDefaults 中保留一个标志,指示您是否应该在启动时注册推送通知.默认情况下,该标志为 false.
  2. 启动时,请检查标志.如果是真的,请立即注册.否则,请勿注册.
  3. 当用户第一次做一些会导致推送通知的事情时,注册推送通知并在 NSUserDefaults 中设置标志.
  1. Keep a flag in your NSUserDefaults indicating whether you should register for push notifications at launch. By default the flag is false.
  2. When you launch, check the flag. If it's true, register immediately. Otherwise, don't register.
  3. The first time the user does something that would cause a push notification, register for push notifications and set the flag in NSUserDefaults.

这样,当用户收到推送通知警报时,他就会知道为什么会收到推送通知,并且实际上可能会说是.

This way, when the user gets the push notifications alert, he has some idea why he's getting it, and might actually say yes.

这篇关于iOS - 要求在初始拒绝后启用推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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