iPhone 睡眠模式下的 UILocalNotification
我正在开发一个 VoIP 应用程序。
当我按下锁定按钮(应用程序进入睡眠状态)并且服务器发送请求时,我会显示本地通知。 本地通知按其应有的方式显示,并且按钮滑块文本显示“滑动以回答”。如果我滑动到此处,应用程序就会打开。
但是,如果现在我再次按下锁定按钮,然后解锁,通知仍然会显示,并且滑块文本已更改为“滑动解锁”。
现在,当我滑动解锁时,就好像我按下了常规通知栏上的“关闭”按钮,这意味着该应用程序将无法打开。
我的问题是为什么第二次仍然出现本地通知?如果是这样,有没有办法跟踪解锁按钮事件或解锁滑块,以便我可以告诉服务器我不想接听电话?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该通知只是一个短时间的对话框(即用户可以直接与其交互),直到设备再次锁定(通过使用按钮或在大约 15 秒的超时后自动锁定)。
之后,它变成通知。除了阅读消息之外,用户无法直接与其交互。
抱歉,但不幸的是,情况并没有好转。
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.