UILocalNotification in sleep mode on iPhone

╄→гoц情女王★ 提交于 2020-01-11 11:28:26

问题


I'm developing a Voip application.

When I press the lock button(app goes to sleep), and the server sends a request I present a local notification. The local notification is presented as it should and The button slider text says "slide to answer". If I slide here, the app gets open.

However, if now I press again the lock button, and then unlock, the notification is still presented and the slider text has changed to "slide to unlock".

Now, when I slide to unlock, it's as if I pressed the "close" button on a regular notification bar, meaning the app won't open.

My question is why on the second time the local notification is still presented ? and if so, is there a way to track the unlock button event or the unlock slider so I can tell the server that I don't want to answer the call ?

Thanks


回答1:


The notification is only a dialog (i.e., the user can interact with it directly) for a short time - until the device is locked again, either by using the button or automatically after a time-out of about 15 seconds.

After that, it turns into a notification. The user cannot interact with it directly, apart from reading the message.

Sorry, but it doesn't get any better unfortunately.



来源:https://stackoverflow.com/questions/6044092/uilocalnotification-in-sleep-mode-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!