How to show push notification dialog based on conditions - ios

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

Related

Disable home button tapped while push notification popup displayed

When push notification popup is shown in app and tapped on home button then push notification popup will hide without taking any action (Allow/Don't Allow)
So, is there any way that without taking any action on push notification popup and when tapped on home button popup will not hide. Screen will remains same?
Thanks
Please check push notifications delegate methods.

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.

IOS push notification delete

I use a phone gap plugin and xcode 5.
Lets see the example of the problem:
The application is in background or closed.
I send the notification.
User sees the notification pop up, without clicking on it.
I send another notification.
If user open notification bar it will see two notification actually i want
to delete the previous some how and present to user only the second notification.
The eqvivalent in java is NotificationManage.cancelAll();
For now each/all notification i send are shown when user open notifications bar.
Any help appreciated.
You have (the app has) no control over that.
The user controls how many notifications they see in notification center. Notifications can be removed by the user and will be removed when acted upon (the app is opened from the notification).
You can do this by [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
in the method didReceiveRemoteNotification. In this way notification center will be cleared.

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