文章目录
  1. 1. 项目配置
  2. 2. 代码
  3. 3. 使用流程
  4. 4. App审核

ps:打印,又是打印,销售不知道哪里找来个打印机要支持。好吧,不是所有的蓝牙打印机都是可以用corebluetooth去连接的。这次是Bixolon,spp型号的打印机。网上一搜,是个韩国的打印机。中国连官方代理也没有,只有淘宝有个买家,自称代理。这种打印机用的是苹果MFI认证的连接方式。免不得要适配下,废话不多说,献上教程。

项目配置

  • Build Phases 中添加ExternalAccessory.framework
  • Capabilities
    1.启用background modes 勾选External accessory communication、 Uses Bluetooth LE accessories、Acts as a Bluetooth LE accessory
    2.启用Wireless Accessory Configuration
  • info.plist添加Supported external accessory protocols
    Screen shot

代码

一般调用对应的sdk即可,用corebluetooth的寻找打印机是找不到的。

使用流程

  • 手机or pad蓝牙设置中先连接打印机。一般要输pin码。bixolon的pin码默认是0000
  • 连接好打印机后再去代码中调用sdk查找打印机,方能找到打印机。然后对应发指令即可。ps:网上有不需要sdk也可以连接打印机。没尝试过,代码略多

App审核

很关键,使用MFI认证的连接方式是必须要从厂家获取PPID的。这个流程一般是这样的。跟厂家沟通,厂家一般会发你一个表格可以填,需要的内容app名称、版本号、bundleid等。然后厂家拿这个去苹果申请把bundleid添加到他们的ppid里面。然后把ppid告诉我们。我们放到itunes里面的remark中备注好即可。一般如果已经审核被拒绝了,放上去之后最好在拒绝后面回复下已经放入备注中,不然人家也不会注意看,分分钟又拒绝了。在下已然有这样的经历。
这里大致贴下拒绝信息:
—– MFi - PPID —–

We have started your app review but are unable to complete the review because we cannot locate the MFi Product Plan ID (PPID) of the hardware accessory associated with your app.

If you do not know the PPID, please contact the accessory manufacturer for this information. Once you have the PPID, please enter this information in the Notes section for your app in iTunes Connect.

To edit the Notes section:

  • Log in to iTunes Connect
  • Click on “My Apps”
  • Select your app
  • Scroll down to “App Review Information”
  • Update “Notes”
  • Click Save
  • Click Submit for Review

Once you’ve updated the Notes section with the PPID, we can proceed with your app review.

文章目录
  1. 1. 项目配置
  2. 2. 代码
  3. 3. 使用流程
  4. 4. App审核