I'm adding a video chat to my app and use PushKit to get a pushNotification when the app is in the background. I Can't use the CallKit for video as it mess up the SDK I'm using so I have added a local push notification that fire up from the PushKit delegate method.
I'm wondering how Whatsapp does it with their Video call. For now they are showing a push notification but in a way that I can't recognize. The push is fired up with two vibrations and after two seconds there is a new push that overlaps the first notification and you can feel another two vibrations and so on until you answer. How do they do it as you can't add vibration over and over again and how do they delete the notification and establish a new one in the background as the NSTimer is not working in the background. If I add [[UIApplication sharedApplication] beginBackgroundTaskWithName:expirationHandler:]
then I can use the timer for 180 seconds but only if the app was active.
So the real problem is how to add a local notification that can repeat itself few times and also add vibration to it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…