Re-post: iOS modify App auto launch when iPhone is connected to external accessory

孤人 提交于 2019-12-11 11:41:51

问题


I had asked this question earlier but was closed for unclear or insufficient details. Hopefully, I have explained it better. Here it goes.

I am building an iOS application that communicates to the external accessory using a proprietary protocol (over iAP). I know that by adding a unique protocol name in the info.plist file, the application can be made to launch automatically when iOS device is connected to the external accessory (I am aware that support is needed from the external accessory device too).

Applications that are able to communicate with an external accessory should declare the ?protocols they support in their Info.plist file. Declaring support for specific protocols lets the system know that your application can be launched when that accessory is connected. If no application supports the connected accessory, the system may choose to launch the App Store and point out applications that do.

In my application, I wish to give the user a graphical interface to enable or disable automatically launching the application. Behind the scenes, this would require setting the protocol name to a pre-defined value to enable it or clearing it to disable it.

I would appreciate if someone can give me information on how to modify the protocol id programatically.


回答1:


To load app automatically when Supported external accessory is connected, we need to put two things in the Info.plist:

  1. Supported external accessory protocols

    Item 0          yourCompanyProtocol
    
  2. Application does not run in background

    YES
    


来源:https://stackoverflow.com/questions/11216713/re-post-ios-modify-app-auto-launch-when-iphone-is-connected-to-external-accesso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!