如果应用程序被锁定,可以接收蓝牙数据吗?

发布于 2024-12-28 13:01:58 字数 51 浏览 2 评论 0原文

就是这个问题。您会看到其他设备声称它们可以,但构建在较旧的平台上。任何示例代码都会很棒。

Simply that question. You see other devices stating that they can, but built on older platforms. Any sample code would be great.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吝吻 2025-01-04 13:01:58

是的,这是可能的。您需要在 info.plist 文件中将 UIBackgroundModes 设置为“bluetooth-central”。

另请注意,技术问答iOS 开发者库中的 QA1657 内容如下

外部配件框架旨在允许 iOS 应用程序仅与在 Apple 开发的硬件配件进行通信MFi 被许可人计划。符合 MFi 标准的配件可以作为有线设备实现,这意味着它们插入 iOS 设备的 30 针连接器,也可以作为无线设备实现,从而使用蓝牙作为通信通道。无论哪种方式,使用外部附件框架的应用程序都不会收到有关附件存在的通知,除非该附件将自身标识为符合 MFi 标准,即它是专门设计用于与 iOS 应用程序交互的。

开发人员参考资料还指出,iOS5 中有一个用于低功耗设备的核心蓝牙框架,但它仅适用于蓝牙 4.0 设备 (BTLE),目前在 iPhone 4S 上。

Yes, it is possible. You need to set UIBackgroundModes to "bluetooth-central" in info.plist file.

Note also, that Technical Q&A QA1657 in iOS Developer Library says the following

The External Accessory framework is designed to allow iOS applications to communicate only with hardware accessories that are developed under Apple's MFi licensee program. MFi compliant accessories can be implemented as wired devices, meaning they plug in to the iOS device's 30-pin connector, or as wireless devices, whereby they use Bluetooth as the communication channel. Either way, an application that uses the External Accessory framework will not be notified of an accessory's presence unless the accessory identifies itself as being MFi compliant, i.e., it was specifically designed to interface with an iOS application.

Developer reference also says that there is a Core Bluetooth framework for Low Energy devices in iOS5, but it's for Bluetooth 4.0 devices (BTLE) only, currently on the iPhone 4S.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文