【问题标题】:Fire event when iphone app is in background?iphone应用程序在后台时触发事件?
【发布时间】:2012-04-18 11:38:19
【问题描述】:

我们可以注册 iPhone 应用程序在使用位置/音乐功能时在后台运行。我的问题是我们可以根据位置更新触发偶数吗?例如:当我在后台达到某个预定义的纬度/经度而不启动应用程序时,将纬度/经度发送到服务器?

如果有任何帮助,我不介意使用企业解决方案。

【问题讨论】:

标签: iphone enterprise multitasking background-process


【解决方案1】:

查看 significant location change API,它应该提供您想要的,虽然不是很准确。
http://longweekendmobile.com/2010/07/22/iphone-background-gps-accurate-to-500-meters-not-enough-for-foot-traffic/

【讨论】:

  • +1 哇,他们做了一些非常详尽的研究。我正在查看基于人流量的应用程序,猜测后台的准确度水平还不够。将不得不进一步研究。
【解决方案2】:

是的,这可以做到。在Getting the User’s Location上查看 Apple 的详细信息

【讨论】:

    【解决方案3】:

    是的,这是可能的。如果您使用 locationmanager 并通过委托获取新位置,您的代码将在不打开应用程序的情况下执行。

    【讨论】:

      【解决方案4】:

      你需要实现这个 API

      - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region{
           //write code here
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-10-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-15
        • 2022-09-27
        相关资源
        最近更新 更多