如何使用蓝牙信号(BLE)唤醒iOS应用程序 [英] How to wake up iOS app with bluetooth signal (BLE)

查看:516
本文介绍了如何使用蓝牙信号(BLE)唤醒iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用带有CoreBluetooth的BLE(没有iBeacon),有没有办法在设备收到蓝牙信号时唤醒应用程序未运行的应用程序?

using the BLE with CoreBluetooth (no iBeacon), is there a way to wake app a not running app when the device receives a bluetooth signal?

我是使用redbearlab的BLE Shield模拟灯塔( http://redbearlab.com/bleshield/ )。

I'm simulating a beacon with the redbearlab's BLE Shield (http://redbearlab.com/bleshield/).

谢谢,
DAN

Thanks, DAN

*更新03/05/14 *

Apple似乎已经推出了iOS 7.1的主要更新:现在iOS会在检测到与您的应用匹配的UUID时为您打开应用程序。该应用程序只需要安装,它不必运行(AppDelegate中的逻辑需要回答唤醒调用)。

It looks like Apple has introduced a major update with iOS 7.1: now iOS will open your app for you if it detects a UUID that matches your app. The app only needs to be installed, it doesn't have to be running (logic in AppDelegate needed to answer the wake-up call).

推荐答案

如果应用程序在后台运行然后关闭(我的意思是终止 - 当你双击主页按钮时,你不再在后台应用程序列表中看到它)由于来自其他应用程序的内存压力,当调用委托时(假设您在.plist中列出了背景模式),iOS将会再次唤醒它。

If the app was running in the background and then closed (I mean here terminated - and you do not see it anymore in the list of background apps when you double click the home button) due to memory pressure from other apps, then the iOS will take care of waking it up again when a delegate is called (assuming you have background modes listed in .plist).

如果应用程序正在运行用户背景然后关闭(我的意思是终止。所以用户双击以获取在后台运行的应用列表,然后在后台列表中单击您的应用,直到它摆动然后按下'x'在应用程序旁边杀死它)然后这清楚地表明用户不希望应用程序在后台运行,并且应用程序将不会重新启动。用户必须重新启动应用程序,以便其代表在后台再次开始运行(iOS7中的新功能)。

If the app was running in the background and then closed by the user (again I mean here terminated. So the user double clicked to get the list of apps running in the background and then clicked on your app in the background list until it wiggled and then pressed the 'x' next to the app to kill it) then this is a clear indication that the user does not want the app running in the background and the app will not be re-launched. The user has to relaunch the app for its delegates to start functioning again in the background (new in iOS7).

更新:
我不确定是否这样在文档中,但它在CoreBluetooth WWDC 2013视频中。我建议你看。他们花了很多关于CoreBluetooth在后台运行的视频。

Update: I am not sure if this is in the documentation but it is in CoreBluetooth WWDC 2013 Video. I recommend you watch it. They spent a good portion of the video on how CoreBluetooth behaves in the background.

这篇关于如何使用蓝牙信号(BLE)唤醒iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆