[英]send data to server when app is background
I'm developing an iOS app which interacts with BLE device. 我正在开发一个与BLE设备交互的iOS应用。 what I wanted to do is, app detects BLE device and gets info from it in background mode. 我想做的是,应用程序检测到BLE设备并在后台模式下从中获取信息。 After getting info from BLE in background mode, I want to send that info to server. 在后台模式下从BLE获取信息后,我想将该信息发送到服务器。 how can i achieve this functionality. 我如何实现此功能。
Yes you can do this, 是的,你可以做到
Keep one connection request alive in background, whenever your BLE device advertised your app should automatically connect with BLE device and getting information from your BLE device as per your services implementation. 每当您的BLE设备宣告您的应用应自动与BLE设备连接并根据服务实现从BLE设备获取信息时,请在后台保留一个连接请求。 After getting data from BLE device you can send that data via web service using background task. 从BLE设备获取数据后,您可以使用后台任务通过Web服务发送该数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.