如何获得返回]允许推送通知"之后对话框被驳回一次? [英] How to get back "Allow Push Notifications" dialog after it was dismissed once?

查看:103
本文介绍了如何获得返回]允许推送通知"之后对话框被驳回一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个应用程序,是严重依赖于APN。在我的应用程序的最初开始,iOS的询问这个程序被允许使用APN(如 registerForRemoteNotificationTypes的结果:调用)。然而,一旦被解雇,这个对话框是永远不会弹出回来。我必须手动去设置 - >&通知 - GT;的MyApp 启用/禁用存在的东西。那么,有没有办法避免这种喧嚣和实际体验哪些用户将在体验的第一启动每次我启动我的应用程序在调试模式下的时间?


解决方案

下面是苹果href=\"https://developer.apple.com/library/ios/technotes/tn2265/_index.html\">如何你可以做到这一点:


  

重置推送通知警报的权限在iOS


  
  

第一时间推送通知启用推的应用注册,
  iOS的询问用户是否他们希望收到通知的应用程序。
  一旦用户回应此警报它不是$ P $再次psented
  除非该设备恢复或应用程序已被卸载在
  至少一天。


  
  

如果要模拟你的应用程序的第一次运行,你可以离开
  卸载了一天的应用程序。您可以实现后者不
  实际上按照以下步骤等待了一天:


  
  

      
  1. 从设备中删除您的应用程序。


  2.   
  3. 关闭设备完全和重新打开它。


  4.   
  5. 进入设置>常规>日期和放大器;时间,并设置提前日期一天或更


  6.   
  7. 关闭设备完全再次打开它。


  8.   

I am building an app that is heavily relies on APN. Upon the very first start of my app, iOS asks if this app is allowed to use APN (as a result of registerForRemoteNotificationTypes: call). However once dismissed, this dialog is never popping up back. I have to manually go to Settings->Notifications->MyApp to enable/disable things there. So is there a way to avoid this hustle and actually experience what user will experience upon the very first start every time I start my app in debug mode?

解决方案

Here's how Apple say you can do it:

Resetting the Push Notifications Permissions Alert on iOS

The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.

If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by following these steps:

  1. Delete your app from the device.

  2. Turn the device off completely and turn it back on.

  3. Go to Settings > General > Date & Time and set the date ahead a day or more.

  4. Turn the device off completely again and turn it back on.

这篇关于如何获得返回]允许推送通知"之后对话框被驳回一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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