简体   繁体   English

Xcode推送通知没有警报

[英]Xcode push notifications without alert

I have just implemented Push Notifications in my iPhone App. 我刚刚在我的iPhone应用程序中实现了推送通知。 And I am searching for almost a similar thing like here: 我正在搜索几乎类似的内容:

Effective automatic refresh of UITableview without user interaction (IOS 5) 有效的自动刷新UITableview,而无需用户交互(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. 使用MKMapKit,我可以确定何时发生这种情况,然后将位置更改发送到服务器。 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. NSTimer不是我要寻找的东西,因为这不是我认为的非常有效的方法。

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? 您自己的服务器是否跟踪用户移动,并在下次激活时从您的App内部询问有关最新移动历史的信息?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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