iOS Push Notification Banner shown twice for a single Push

前端 未结 8 653
攒了一身酷
攒了一身酷 2020-12-02 16:52

I\'ve noticed that sending a Push notification results in the following behavior:

See how the banner is shown a second time, after a short delay?

At

相关标签:
8条回答
  • 2020-12-02 17:21

    Are you sure you are doing all your setup right?
    if you will provide more code it will be easier to find the bug. It's definitely not an iOS bug.


    Basic things to check when you have trouble with server notifications:

    1. Check your provisioning profile and clean up all unused certificates.
    2. Be sure your server configuration is alright. Again, more details are needed for full answer.

    If you are doing this offline then usually you missed something in your code or your handler for secluded posts is called two times.

    0 讨论(0)
  • 2020-12-02 17:21

    We were facing the same issue on IOS 9.3.1

    We used urban airship for managing notifications and this was our setup

    let config = UAConfig.default()
    
    UAirship.setLogging(false)
    UAirship.takeOff(config)
    UAirship.push().userPushNotificationsEnabled = true
    UAirship.push().notificationOptions = [.alert, .badge, .sound]
    UAirship.push().backgroundPushNotificationsEnabled = false
    UAirship.push().pushNotificationDelegate = self
    

    After many attempts we simply removed the following line and it worked!

    UAirship.push().notificationOptions = [.alert, .badge, .sound]
    

    I hope this will help someone.

    0 讨论(0)
  • 2020-12-02 17:23

    I think the wrong answer is accepted here (If this is about migrating from Parse to OneSignal). Because for OneSignal there doesn't seem to by any proper solution for this. I am also looking for the solution if any one is having. The only workaround for this was, to restart the phone.

    But its weird. We can't ask all the users to reboot their device.

    0 讨论(0)
  • 2020-12-02 17:24

    According to this answer on a similar question, this issue was reported as rdar://23569779 and should be fixed in the iOS 9.3 public release.

    Please leave a comment if you reproduce this issue in iOS 9.3+

    Supposedly fixed in:

    iOS 9.2.1 beta (Build: 13D11)

    0 讨论(0)
  • 2020-12-02 17:27

    I was experiencing the same issue, but after countless hours trying to debug, I realized that I was calling registerUserNotificationSettings(settings) twice in didFinishLaunchingWithOptions:. Verify that you're not doing the same

    0 讨论(0)
  • 2020-12-02 17:30

    I know this answer is a couple years after the original post, but in case this helps anyone...

    In my case, I was using CloudKit notifications and had accidentally created two subscriptions that tracked the same record type!

    0 讨论(0)
提交回复
热议问题