iOS Push Notification Banner shown twice for a single Push

前端 未结 8 697
攒了一身酷
攒了一身酷 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    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.

提交回复
热议问题