iOS 远程通知处理
简单的问题,我正在开发一个启用 APNS 的应用程序,我只想知道是否有一种方法可以在应用程序未打开(不在后台)并且应用程序收到远程通知时;
我可以在用户不知情的情况下在后台打开应用程序,并执行需要完成的操作。
我已经查看了文档,但没有明确说明可以或不能执行此操作(根据我读到的内容),它说用户必须手动打开应用程序(通过点击警报或应用程序图标)。
我认为我想要做什么很清楚,但我也会举一个例子。
示例)
默认的邮件应用程序会使用徽章图标提醒用户有新电子邮件,显示新电子邮件的数量以及声音。然后,用户必须点击应用程序图标才能打开应用程序并下载新电子邮件。
我希望能够拥有徽章和声音,但在后台(静默)打开应用程序并下载新电子邮件,这样当用户确实打开应用程序时,电子邮件就已经在那里,可以阅读了。
感谢您的任何帮助。
Quick question, I am working on an APNS enabled app and I just want to know if there is a way that when the app is not open (not in background) and the app receives a remote notification;
Can I open the app in the background, unbeknownst to the the user, and do do what needs to be done.
I have looked at the docs but it doesnt explicitly say that this can or cannot be done (from what I read), it says that the user has to open the app manually (either from tapping an alert or the app icon).
I think it is clear what I'm looking to do however i'll put an example aswell.
Example)
The default Mail app alerts the user of new emails with a badge icon, showing the number of new emails, aswell as a sound. The user must then tap the app icon to open the app and download the new emails.
I want to be able to have the badge and sound but open the app in the background (silently) and download the new emails, so that when the user does get around to opening the app the emails will already be there, ready to read.
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,你所描述的情况是不可能的。
获得类似功能的唯一方法是构建一个 voip 应用程序。请参阅本文档中的相关部分。
无论如何,我怀疑你的应用程序会进入应用程序商店,那么......
unfortunately, what you describe is not possible.
the only way you could get something like that is to build a voip app. see the relevant section in this document.
anyway, I doubt that your app would get into the App Store, then...