iOS Push Notification Banner shown twice for a sin

2019-01-16 15:59发布

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

Push Banner is shown twice?

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

At first I thought that our backend was mistakenly sending 2 push notifications, one after the other.

However, this appears to be default iOS behavior for a single Push notification. The banner is shown, then immediately "shown again". This results in this jittery UI shown in the gif. The banner appears to be received twice.

Tested using iOS 9.0.2.

I do not recall seeing this behavior from other apps that send me Push Notifications. Am I doing something wrong that would cause the banner to show twice?

Radar:

Engineering has determined that your bug report (23133694) is a duplicate of another issue (23130766) and will be closed.

8条回答
在下西门庆
2楼-- · 2019-01-16 16:38

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.

查看更多
够拽才男人
3楼-- · 2019-01-16 16:43

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!

查看更多
登录 后发表回答