iOS 10 Local Notifications dismissing early when screen is unlocked

229 views Asked by At

I recently switched over to using PushKit and implementing local notifications so that I could do stuff like make the phone ring while another user is "calling" and have the notification dismiss as soon as the caller hangs up.

I am doing this by using pushkit and when the caller calls, a pushkit push is sent and a local notification that has a sound (repeating) for 28 seconds plays so that the notification stays up the whole time while the sound plays (at least in older iOS versions). And when the caller hangs up, another pushkit push is sent, and the previous local notification is canceled and another "missed call" one pops up. If the caller doesn't hang up, the call times out after 20 seconds and the "missed call" notification is sent then.

So my problem is that in iOS 10, if the screen is unlocked, the "ringing" notification goes away after about 6-7 seconds regardless of what the caller does. Then when the caller hangs up, the "call missed" notification displays.

On iOS 9 and iOS 8, the notification stays on the users screen until the user hangs up or the call times out.

Is there something special you have to do in iOS 10 to make the local notification stay on screen longer than 6-7 seconds if the screen is unlocked?

0

There are 0 answers