简体   繁体   English

向iOS上特定位置的用户发送推送通知(后台和已杀死)

[英]Sending push notification to users in specific location on iOS (Background and killed)

I've been reading around SO about this and the only close question i've found is this one , which has 33 views and one zero-vote answer that might be correct. 我一直在阅读有关这方面的问题,我发现的唯一一个非常接近的问题就是这个 ,它有33个视图和一个零投票答案可能是正确的。 And its not exactly what i want. 它不完全是我想要的。 And i've found also this one , but i'd like to know if there is a built-in way beforehand. 我也找到了这个 ,但我想知道事先是否有内置方式。

I'm trying to send notification to every user of my app that is in a specific area. 我正在尝试向我在特定区域的应用的每个用户发送通知。 For the sake of the discussion lets call that Brussels. 为了讨论起见,我们打电话给布鲁塞尔。 When a user (lets say, Barcelona) uses my app, at some point I need him to trigger a notification to all the users in brussels. 当用户(比方说巴塞罗那)使用我的应用程序时,我需要他向布鲁塞尔的所有用户触发通知。 And when one or more of the guys in Brussel has followed the notification instructions, I need to send one new notification with new instructions to the Barcelona dude. 当布鲁塞尔的一个或多个人按照通知说明进行操作时,我需要向巴塞罗那老兄发送一条带有新指令的新通知。

Is this in any way achievable at all with iOS? 这在任何方面都可以通过iOS实现吗? In only a couple of words : 只有几个字:

Make it so that an area generates notifications to all the users in it until someone follows the instruction. 使其成为一个区域为其中的所有用户生成通知,直到有人遵循该指令。 When that is done, one specific user recieves one notification. 完成后,一个特定用户收到一个通知。 The app can be in background or even closed. 该应用程序可以在后台甚至关闭。 Can we do that? 我们可以这样做吗?

If so, can anyone point me in the right direction? 如果是这样,有人能指出我正确的方向吗? :) :)

You can use Core Location Region Monitoring for this. 您可以使用核心位置区域监控。 (You can solve this with Local Notifications instead of Push) (您可以使用本地通知而不是推送来解决此问题)

Read the guide here: https://developer.apple.com/library/ios/documentation/userexperience/conceptual/locationawarenesspg/RegionMonitoring/RegionMonitoring.html 请阅读此处的指南: https//developer.apple.com/library/ios/documentation/userexperience/conceptual/locationawarenesspg/RegionMonitoring/RegionMonitoring.html

  • it is working when you app is not running in the background (killed) 你的应用程序没有在后台运行时它正在工作(被杀)
  • you have to use requestAlwaysAuthorization on iOS8 你必须在iOS8上使用requestAlwaysAuthorization

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

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