【问题标题】:Is it possible from iPhone application to connect with server if app is not running?如果应用程序未运行,是否可以从 iPhone 应用程序连接到服务器?
【发布时间】:2011-11-21 18:54:10
【问题描述】:

其实我有以下场景:

我想创建一个应用来检查用户的当前位置并根据用户的当前位置发送 Apple 推送通知。

我知道在应用程序运行时有可能,但我想知道,当应用程序未运行时这可能吗?我的应用有什么方法可以将用户的当前位置发送到我的网络服务器,以便它可以发送相关的推送通知?

【问题讨论】:

  • 您应该将您的问题重新表述为:is it possible for an iPhone app to connect with a server when running in background

标签: iphone push-notification apple-push-notifications currentlocation


【解决方案1】:

是的,这是可能的。转到您的info.plist 并使用所需的背景模式键添加一个新行。打开刚刚创建的数组,并将第 0 项的键值设置为“App registers for location updates”。

【讨论】:

    【解决方案2】:

    是的,您只需注册为基于位置的应用程序。请参阅位置感知编程指南中的 Getting the User’s Location 和 iOS 应用程序编程指南中的 Tracking the User’s Location

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-26
      相关资源
      最近更新 更多