简体   繁体   中英

Xcode push notifications without alert

I have just implemented Push Notifications in my iPhone App. And I am searching for almost a similar thing like here:

Effective automatic refresh of UITableview without user interaction (IOS 5)

Let me say I have two Users. one user is changing his position. With MKMapKit I can determine when this happens and I send a location change to my server. Then I send a Push Notification to the other device and he sees "live" that the user is changing his position. But there is one problem: if the device is locked I'll get a Notification every few seconds if the other device is moving. Is there a possibility to hide the alerts and that only the app knows that the other user has changed his position? So I am searching for a possibility that my app knows to update the location of the other users if he changed but without getting every time an alert. And a NSTimer is not the thing I am searching for because this is not a very effective way I think.

Thank you in Advance!

Pretty sure if your App is locked, ie in the background you can't directly send messages to it. Have you're own Server track user movement and ask it about the latest movement-history from inside your App the next time it becomes active?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM