Handle Notification Permission Alert buttons clicks - ios

Can we handle the buttons of notification's permission alert? I have attached an image of this alert. This alerts comes when we install the app for the first time on a device. If the user clicks on "Don't Allow" then the notification feature will be disabled for this app.
So, if the user clicks "Don't Allow", then I want to display a confirmation alert and inform the user that they can enable it from settings again. For this purpose I need to handle notification Alert's button (see the attached image).
If anyone knows the answer to this, please reply.
Thank you.

If push notifications were disallowed by user the delegate method :
- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err { }
should be called. This should be the place to show your alert view.
Give it a try!
Cheers

Related

iOS 10 Push Notification Tap Handler

I am implementing Push Notifications the iOS 10 way and not able to figure out how would I intercept user's tap on the notification banner. None of the delegate call back gets called when user tap on the banner both in background and foreground mode. This looks more of an API issue in iOS SDK itself.
Anyone experienced the same and have a work around? Please let me know.
Ok, below delegate call back gets called when user tap on the notification. I had implemented specific actions on the notification banner and was putting a check on those action identifiers and completely missed the user tap :).
- (void)userNotificationCenter:(UNUserNotificationCenter *)iCenter didReceiveNotificationResponse:(UNNotificationResponse *)iResponse withCompletionHandler:(void(^)())iCompletionHandler

How to custom push notification notice?

How to custom push notification button for when presented with the option to select to "Allow" or "Don't allow" push notification? Is it possible?
Thanks.
You can't customise the alert displayed that asks the user whether to Allow push notifications or not.
What some apps do is show an alert or image explaining what the push notifications are for, and when you press allow it shows the system Allow/Don't Allow alert.

How to show push notification dialog based on conditions

I'm frustrated of finding the solution about this problem. I have been developing an application that will prompt an UIAlertView to the user at the first time it starts. I want that upon user choosing Agree, then the push notification dialog appears. But the problem is the push notification dialog appeared at the SAME TIME that UIAlertView was prompted to the user. How can I make the push notification dialog appears only after the Agree button of the UIAlertView was tapped?
"Use the shared instance of [UIApplication sharedApplication] to register for push notification in your view controller when the alert view is dismissed. Then, the push notification alert will appear after your alert view."
Thanks to insane-36

NewsStand, Show the push notification alert view when I want?

I know this has been asked: How to show "Would like to send you Push Notifications" Alert View again? ... But My question is kind of different. My question is that is it possible to prompt this when ever I want programmatically (not for debugging but for real). Probably not because this is an alert triggered by the operating system, but is there a way to "undo" if a user clicked "don't allow". My app has a tutorial I want to pop this message when the user finishes the tutorial. Should I just register for push notifications after the tutorial?. Or what the user has to "allow" on the settings menu so I can add it to the tutorial. Thanks
To trigger popup you provide on image you should call
[[UIApplicaton sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability]
This is possible to do in any place in app.
To check available permissions use:
UIRemoteNotificationType* enabledTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

PushNotification in iOs and Application icon is clicked

I receive PushNotification as badge as well as alert and are displayed as badges on the app icon.
I receive the payload successfully when I click on alert, which appears at top area of the screen.
But, if the notification is received and I click on the application icon i don't get the payload in any of below mentioned the methods.
application:didFinishLaunchingWithOptions:
application:didReceiveRemoteNotification:
So, what could be the problem or have I missed something in handling such case.
That would be expected behavior. You don't want to show the push notification for the user if he himself did not actively chose to to tap on the alert. If user is in your app while receiving notification you can ask the user if he wants to view it or dismiss it.

Resources