Ios 12 Show Push Notification Dialog Again

8 Answers eight

Here's how Apple say you can exercise it:

Resetting the Push Notifications Permissions Warning on iOS

The offset time a button-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 twenty-four hours.

If you desire to simulate a first-time run of your app, you can go out the app uninstalled for a 24-hour interval. You can achieve the latter without really waiting a solar day by following these steps:

  1. Delete your app from the device.

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

  3. Go to Settings > General > Date & Fourth dimension and set the date ahead a twenty-four hours or more.

  4. Turn the device off completely once more and plough information technology dorsum on.

user avatar

brandonscript

62.7k 29 golden badges 151 silverish badges 209 statuary badges

answered February five, 2022 at fifteen:34

user avatar

6

  • Wow... Good piece of work Apple :) Simply cheers! Still improve than nada. I'll give it a shot.

    Feb 5, 2022 at xviii:26

  • Side effect: If yous do this on an iDevice that have iMessages enabled, moving the clock ane day into the future will disable iMessage. And then after you have completed the to a higher place and reset the clock, retrieve to enable iMessages over again or you will not be able to send or receive

    Mar 16, 2022 at 18:39

  • Something I've just found: Later yous reset the permissions, whenever the prompt shows again, you tin turn off/on the phone instead of answering the prompt, and that'll go far prompt again on the next app run. Useful for changing code trying to figure out if/when sure code-paths would cause the prompt.

    Jan 17, 2022 at 6:fifty

  • @ThomasWatson: would turning on plane mode avoid iMessages to exist turned off?

    Jul xviii, 2022 at 10:14

  • @Mojo66 I think it would have the same effect, as turning iMessage on/off isn't related to your online condition - but give information technology a attempt... I haven't tested it

    Jul 18, 2022 at 21:42

Since fourth dimension is money and the other methods accept FOREVER—simply change your packet ID over and over while debugging, each time notifications volition become queried fresh. Once you are satisfied with code return to original package ID.


Key Notes from comments below:

  • Temporarily plow off all other Capabilities (like IAP) to get around needing to change the provisioning profile.

answered May 24, 2022 at 21:38

user avatar

v

  • I think this is definitely best, fastest and safest way to go app back to information technology's initial state.

    May 29, 2022 at 9:34

  • But wouldn't you demand to change the provisioning profile all the time?

    Aug 17, 2022 at 17:18

  • @VanDuTran I don't accept to, button nevertheless worked for me. But even if you had to, it would be so much faster than the current marked solution. Haha!

    Aug 17, 2022 at 18:25

  • @AlbertRenshaw Oh my, the current solution doesn't fifty-fifty work for me... I set it to two days forward..

    Aug 17, 2022 at 18:40

  • Temporarily turn off all other Capabilities (like IAP) to get around needing to change the provisioning profile.

    January 13, 2022 at xix:41

On iOS ix.x, yous can get the prompt every fourth dimension you delete the app and reinstall it. This is true for both AppStore production downloads and adhoc mode. The device token will be unique each fourth dimension.

@chengsam verified this is truthful in iOS 10 equally well. @WongWray verified this is true in iOS xi as well.

answered Dec thirty, 2022 at 19:36

user avatar

6

  • I'm not seeing the re-prompt bare out in my testing with the ad hoc version of my app distributed through HockeyApp to an iPad Mini (Model A1489 a.chiliad.a. ME276LL/A) on iOS 9.2 (13C75). Can others please weigh in?

    Mar i, 2022 at 19:07

  • I wasn't seeing the reprompt either :(

    Jul xx, 2022 at 13:21

  • Thank yous! It works well on my iOS x. I've just run the app from xCode to the iPhone and uninstall the app before side by side run. Simplest reply hither.

    Oct 6, 2022 at fifteen:25

  • I take tested on my iOS 10 and it worked well. This should be the right answer since 2017.

    Feb 23, 2022 at four:45

  • Tested for iOS 11.x as well. Works in both production and development

    May 2, 2022 at eighteen:38

On IOS10 i can now get the prompt again past but deleting the app.

answered Sep 26, 2022 at xvi:42

user avatar

one

  • this was back in the mean solar day for iOS 8

    Sep 28, 2022 at 17:12

Currently their is no programmatic mode to prompt a user to re-accept Push Notificaitons after they accept already decided to say no.

You should merely check if you have been granted access, and if not display a view reminding the user to manually requite permission in the privacy settings in gild to enable push notification features of your application.

answered Feb five, 2022 at 8:27

user avatar

2

  • I am not even looking for a way to enquire the same thing. All I demand is basically bring the system to the initial state. But I got your point. That'south really what I am doing later by calling [[UIApplication sharedApplication] enabledRemoteNotificationTypes]. The problem is that I wanted to act differently upon app startup. I can endeavour to utilize the same approach I suppose.

    Feb five, 2022 at 8:32

  • I understand what you're trying to practise, but unfortunately it's not possible (unless at that place are some undocumented private APIs to practise then).

    February 5, 2022 at viii:33

If yous're merely testing that the Push Notifications prompt appears correctly, use the simulator. All you lot need to practise is uninstall the app and reinstall, and the prompt will appear again when y'all endeavor to annals for push button notifications.

answered Jul 20, 2022 at thirteen:59

user avatar

1

  • This is definitely improve that doing the whole change-appointment-reset trip the light fantastic toe. Although it merely works on iOS 12 and not 13 :/

    Sep x, 2022 at 4:59

My trouble was not registering for UserNotificationSettings. This allowed the APN to work but not the groundwork audio or badge.

                              [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:zilch]];                          

answered Apr 30, 2022 at 2:01

user avatar

From iOS thirteen and above you lot need to exercise the whole changing-date-reset thing, as pointed out by Eran.

From iOS 12 and below, uninstalling the app is enough. This also works on simulator, you wont get token though since simulator does non support button notifications.

answered Sep 10, 2022 at v:24

user avatar

Not the answer you're looking for? Browse other questions tagged ios iphone objective-c button-notification apple-push-notifications or enquire your own question.

jonespaided.blogspot.com

Source: https://stackoverflow.com/questions/21571978/how-to-get-back-allow-push-notifications-dialog-after-it-was-dismissed-once

0 Response to "Ios 12 Show Push Notification Dialog Again"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel