IOS 10 Local alerts rejected early when screen unlocked

I recently switched to using PushKitand implemented local notificationsso that I can do things like make a phone call when another user β€œrings” and dismiss a notification as soon as the caller freezes.

I do this with PushKit, and when the caller rings, a push is sent PushKit, but local notificationwhich has a sound (repeats) for 28 seconds, plays so that the notification stays on all the time while the sound is played (at least in older versions of iOS ) And when the caller hangs up, another pushkit push is sent, and the previous local notification is canceled, and another β€œmissed call” appears. If the caller does not hang up, the call expires after 20 seconds, and then a missed call is sent.

So my problem lies in the fact that iOS 10, if the screen is unlocked, the notification of calls disappears after 6-7 seconds, regardless of what the caller does. Then, when the caller hangs up, a missed call notification appears.

B iOS 9and the iOS 8notification remains on the user's screen until the user hangs up or the call expires.

Is there anything special in iOS 10 so that a local notification stays on the screen for more than 6-7 seconds if the screen is unlocked?

+4
source share

Source: https://habr.com/ru/post/1665063/


All Articles