简体   繁体   English

除了推送唤醒iOS应用程序之外的其他方式?

[英]Other ways besides push to wake up an iOS app?

Has anyone created an iOS app reacts to events or triggers from external sources other than push (APNS)? 是否有人创建过iOS应用程序对除推送(APNS)以外的外部来源的事件或触发器做出反应? For example, could an iOS app subscribe to a remote topic or queue? 例如,iOS应用程序是否可以订阅远程主题或队列? Or listen for HTTP or socket requests? 或者监听HTTP或套接字请求?

No. 没有。

Application could be launched if: 如果符合以下条件,可以启

  1. User tapped the icon 用户点击了图标
  2. User selected the Push-notification/Local-notification 用户选择了推送通知/本地通知
  3. Application supports url-schemes and is launched while opening URL 应用程序支持url-schemes,并在打开URL时启动
  4. Application supports view/edit of documents and user've selected your app to do this 应用程序支持查看/编辑文档,用户已选择您的应用程序来执行此操作

If anyone has other ideas - feel free to edit or add comments. 如果有人有其他想法 - 随时编辑或添加评论。

App could run in background and have active http-connection/socket. 应用程序可以在后台运行并具有活动的http连接/套接字。 But it couldn't be opened automatically. 但它无法自动打开。

In addition to user action and push/local notifications, an app can be woken by a significant location change, if the app has indicated that it wants to monitor such events. 除了用户操作和推送/本地通知之外,如果应用已指示要监控此类事件,则可以通过重大位置更改来唤醒应用。

See: CLLocationManager Docs 请参阅: CLLocationManager Docs

Look for a method called startMonitoringSignificantLocationChanges . 查找名为startMonitoringSignificantLocationChanges的方法。 If a significant location change occurs while your app is not in the foreground or isn't running at all, your application will be launched in the background, allowing the app to perform background-only operations (eg no view code will run). 如果在您的应用程序不在前台或根本没有运行时发生重大位置更改,您的应用程序将在后台启动,允许应用程序执行仅后台操作(例如,不会运行任何视图代码)。

The app will not launch into the foreground, however, if it is launched due to a significant location change. 但是,如果由于位置发生重大变化而启动,应用程序将无法启动到前台。

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

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