Push Notification without user interaction

社会主义新天地 提交于 2020-01-05 08:06:03

问题


I would like to know if there is any way to use push notification on iOS without user interaction.

I am working on kind of anti-theft application. One of the case, when phone is stolen, we should be able to send command remotely.

The approach that we are currently following is to listen to notification port continuously and when we receive notification, query server if anything has changed. We had to follow this approach because push notification involves user interaction which is not desirable here.

But, we had been facing performance issues because of this and would like to re-consider push notification. So is there any way that we can have it without user interaction?


回答1:


No, push notification can not be handled without user interaction. That is simply impossible. Can you elaborate how you query your server continuosly ? Since you can not keep your app in background for longer period. You can query your server on start up for any change, this is the only thing you can do.




回答2:


While your app is running, you can do push without user interaction BUT on a stock iphone, the os may kill your IOS App at every time when it is in the brackground. you CAN set a key in the info plist to urge the OS to let you run but thats not a reliable way



来源:https://stackoverflow.com/questions/14682430/push-notification-without-user-interaction

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