问题
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