[英]Push Notification App Running in Background When BLE is Connected
I worked on an Application which is Worked on BLE. 我开发了适用于BLE的应用程序。 i want push a notification ( App Running in Background When BLE is Connected) if any changes in Hardware.
如果硬件发生任何更改,我想推送通知(连接BLE时在后台运行应用程序)。 I Read Document
我阅读文件
Even if your app supports one or both of the Core Bluetooth background execution modes, it can't run forever.
即使您的应用程序支持一种或两种Core Bluetooth后台执行模式,也无法永远运行。 At some point, the system may need to terminate your app to free up memory for the current foreground app—causing any active or pending connections to be lost, for instance.
在某个时候,系统可能需要终止您的应用程序以释放当前前景应用程序的内存,例如,导致所有活动或挂起的连接丢失。
can i achieve my goal even my app in Background . 我能实现我的目标,甚至是我在Background中的应用程序。 If It is Possible Suggest me how to Achieve this .
如果有可能,建议我如何做到这一点。 Thanks In Advance.
提前致谢。
You may keep app in background by means of: 您可以通过以下方式使应用程序处于后台:
1.Audiosession(use this to play silent sound) 1.Audiosession(用来播放静音)
2.Location 2.Location
3.VoIP 3.VoIP
Any method can keep App in background and avoid App from being killed by system. 任何方法都可以使App处于后台,并避免被系统杀死。
BLE Runs in the background, you need to specify that your app uses BLE Accessories or your app acts as a LE Accessory in the Background modes in app capabilities. BLE在后台运行,您需要指定您的应用程序使用BLE附件,或者您的应用程序在应用程序功能的“后台”模式下充当LE附件。
I've tried firing local notifications, while the application is in the background. 我尝试在应用程序处于后台时触发本地通知。 BLE even works if the app is killed by the system, when the OS receives some communication from your peripheral or central, iOS wakes your app up and executes the desired function, before putting your app back to sleep.
如果应用程序被系统杀死,则BLE甚至可以工作,当操作系统从您的外围设备或中央设备接收到某些通信时,iOS会唤醒您的应用程序并执行所需的功能,然后再使您的应用程序进入睡眠状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.