I want to ignore push notifications when the app is active. I am handling notifications as follows:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if (application.applicationState != UIApplicationStateActive)
{
[[PushHelper shared] processPush: userInfo];
}
}
But when app is active and device receives push notification, the UIAlertView with notification message appears. How can I disable default handling from UA?
I had the same problem and found solution. If define the delegate method displayNotificationAlert: of UAPushNotificationDelegate protocol with empty body, for example, then the automatic alerts will not be shown:
{
...
[[UAPush shared] registerForRemoteNotifications];
[UAPush shared].pushNotificationDelegate = self;
...
}
- (void)displayNotificationAlert:(NSString *)alertMessage
{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With