简体   繁体   English

iOS - 如何在我的应用程序中集成蓝牙设备

[英]iOS - How to integrate bluetooth devices in my app

I'm trying to create some application that connects to blue tooth devices. 我正在尝试创建一些连接到蓝牙设备的应用程序。 A simple thing like a bluetooth barcode scanner that scans and sends a number to my app. 一个简单的事情,如蓝牙条码扫描仪,扫描并发送一个数字到我的应用程序。 I want to know which framework or something to be used in my app that can integrate the barcode scanner with my app. 我想知道在我的应用程序中使用哪个框架或某些东西可以将条形码扫描器与我的应用程序集成。 Is there any API or examples or tutorials etc that can help me implement such things? 是否有任何API或示例或教程等可以帮助我实现这些功能?

Apple provides an API called the External Accessory framework , which can be used to interact with paired Bluetooth devices or devices connected through wired, Apple Connector at the base of the device. Apple提供了一个称为外部附件框架的API,可用于与配对的蓝牙设备或通过设备底部的有线Apple Connector连接的设备进行交互。

However, to be able to use a paired device from within your application as you desire, you will have to a device that is designed to be compatible with iOS devices (meaning, the manufacturer must be a member of the Apple MFi program ) and the device manufacturer must provide a protocol that you must add to your applications info.plist file. 但是,为了能够根据需要在您的应用程序中使用配对设备,您将需要一个旨在与iOS设备兼容的设备(意味着,制造商必须是Apple MFi计划的成员)和设备制造商必须提供必须添加到应用程序info.plist文件的协议。

If you have bought an off-the-shelf, Bluetooth barcode reader, there is a fair chance that you can not do what you are trying to do. 如果您购买了现成的蓝牙条形码阅读器,那么您很可能无法做您想做的事情。 If the device states that it can be integrated into custom iOS applications, consult the device manufacturer for further support regarding setting up your application to interact with their hardware. 如果设备声明可以将其集成到自定义iOS应用程序中,请咨询设备制造商,以获取有关设置应用程序以与其硬件交互的进一步支持。

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

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