how to activate the ios notification settings programmatically?

后端 未结 3 1375
梦如初夏
梦如初夏 2020-12-21 11:12

My app registers for the notifications like this :

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge | UIR         


        
3条回答
  •  旧时难觅i
    2020-12-21 11:52

    You need to reset push notification permissions.Apple provide a way to reset the permissions-

    Resetting the Push Notifications Permissions Alert on iOS

    For the first time a push-enabled applications, registers for push notifications. iOS asks the user if they wish to receive remote notifications for that particular app. Once the user has responded to this alert it is not presented again and 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.
    

    For more details see: https://developer.apple.com/library/ios/technotes/tn2265/_index.html

提交回复
热议问题