Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm working on a VoIP phone for iOS, and if a call comes in while running in the background, I do a presentLocalNotificationNow with a UILocalNotification message to inform the user. This works fine, however the banner expires and rolls off the screen before the user has enough of a chance to swipe and answer. I have tried scheduling further notifications at regular intervals, but that fills up the notification centre and causes the banner to appear to be tumbling.

Is there some way to prevent the banner from disappearing until I cancel it in some manner? Both the Skype app and Bria VoIP app have managed to come up with a solution where the banner stays until the call is answered, or the callee hangs up.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
267 views
Welcome To Ask or Share your Answers For Others

1 Answer

The best way to do this is to add a sound to the local notification.

The default notification without a sound lasts 5 seconds as a banner, however you can include a sound that is longer, up to 30 seconds that you can play when the local notification is posted. The banner notification will stay on screen as long as the sound is playing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...