Every Push Notification Banner is shown twice on iOS9 [duplicate]
Asked Answered
H

2

8

Since a few hours we have a strange issue in our iOS app: every push notification received on the home screen of iOS will trigger/show the same notification banner twice with a 2 sec delay between them.

  • It only happens on devices with iOS 9.x. On iOS 8.x devices everything is still working as expected.
  • If I set a break point in -[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] it is only called once for each push notification.

Also we did no change in the backend recently (at least a weak) and it also happens for client which are already released and we are 100% certain we did not see the issue before.

We did however change the capability in Xcode of the current development app and had to generate new provisioning profiles as the old ones where tagged as "Invalid".

So for us it looks like an issue on Apple sides. Any suggestions what more to try/check or what to do?

Herrenvolk answered 11/12, 2015 at 11:59 Comment(0)
H
7

It seems like I had exactly the same issue as this dude had: I called [registerUserNotificationSettings:] twice.

Be aware that it might not be as obvious as you think to see if you called the method once or twice:

I called it once on purpose in specific UIViewController. Unfortunately I also called it each time in didFinishLauchingWithOptions:. Don't let yourself be fooled because you see the dialog only once.

If you want to be sure add a logging output in -[AppDelegate application:didRegisterUserNotificationSettings:]. In my case the callback was called twice after I hit OK on the permission dialog.

Since I remove the misplace call in didFinishLauchingWithOptions: I did not see anymore double notifications.

Herrenvolk answered 3/2, 2016 at 10:59 Comment(0)
P
3

I submitted a bug report to Apple (Ticket# 23569779) and the issue appears to have been corrected in iOS 9.2.1 beta (Build: 13D11)

I was experiencing the same issue on iOS9.1 (Build: 13B143) and iOS9.2 (Build: 13c75) for both local and remote notifications across multiple apps.

The simplest way for me to recreate the issue is to schedule a local notification within my app delegate when the app is backgrounded.

- (void)applicationDidEnterBackground:(UIApplication *)application {

    UILocalNotification *notification = [[UILocalNotification alloc] init];

    notification.repeatInterval = NSDayCalendarUnit;
    [notification setAlertBody:@"My test."];
    [notification setFireDate:[NSDate dateWithTimeIntervalSinceNow:1]];
    [notification setTimeZone:[NSTimeZone defaultTimeZone]];
    [application setScheduledLocalNotifications:[NSArray arrayWithObject:notification]];
}

This will result in the notification banner appearing twice:

Duplicate banner images

Pedagogics answered 30/12, 2015 at 1:40 Comment(3)
Was your bug report ticket closed and/or commented on? If you could submit the ticket to OpenRadar that would be very useful! I had this same issue and would love an official comment that it has been fixed.Twandatwang
The bug report was closed and the issue was fixed in iOS 9.2.1 beta (Build: 13D11).Pedagogics
I am getting this issue in iOS 9.3.5 anyone have any update for the same ?Grandioso

© 2022 - 2024 — McMap. All rights reserved.