Every Push Notification Banner is shown twice on iOS9

Hello,

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?


EDIT: On the device itself I get this log message


Dec 17 13:38:39 iPhoneFTropper SpringBoard[54] <Warning>: SBLockScreenNotificationListController: Attempting to remove a bulletin I don't have

Dec 17 13:38:42 iPhoneFTropper SpringBoard[54] <Warning>: Unbalanced calls to begin/end appearance transitions for <SBBannerButtonViewController: 0x14fda6f00>.

Dec 17 13:38:42 iPhoneFTropper SpringBoard[54] <Warning>: SBLockScreenNotificationListController: Attempting to remove a bulletin I don't have


The SBLockScreenNotificationListController message matches the apperance of the two banner.


Regards,

Stefan

Uninstall the app from the device. In 24 hours check again.

Hardly a solution I can suggest to my customer...

In my case it was a solution

Does it happen when you explicitly kill the app from background and send a notification then?

If it happens when you kill the app it must be an Apple bug.

If it happens when your app is in background it might be a local notification you send from your code (do you?) or your server sends another one if it didn't receive an ack from the last one you sent (do you wait for an ack on your server? or is it launch and forget push?)

I'm seeing the same issue here.


application:didReceiveRemoteNotification:fetchCompletionHandler: is being called only once, but the notification banner appears twice, this only happens on the home screen. If I am on the lockscreen of the phone, it does not appear twice.


Did you find a solution Tropper?

I have the same issue. Any news?

Nope. I still have the same issue and no clue why... 😟

Accepted Answer

It seems I found the problem:


http://stackoverflow.com/a/33795327/5385140

http://stackoverflow.com/questions/34223061/every-push-notification-banner-is-shown-twice-on-ios9


TL;DR:

+ Make sure you call [registerUserNotificationSettings:] only once.

+ Do not call it from -[AppDelegate application:didFinishLaunchingWithOptions:] at all as it can not show the permission dialog.


Tropper

@Trooper Apple suggests to call this method on every application launch:

"always call the

registerUserNotificationSettings:
at launch time and use the
application:didRegisterUserNotificationSettings:
method to get the response"

from here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html


3 questions:


1. How can you make sure the user did not change its notifications settings outside of the application?

2. How can you make sure you have the latest device token?

3. How do you avoid calling registerUserNotificationsSettings twice? Do you store the first result in user defaults?

Every Push Notification Banner is shown twice on iOS9
 
 
Q