重新发布:当iPhone连接到外部配件时,iOS修改App自动启动 [英] Re-post: iOS modify App auto launch when iPhone is connected to external accessory

查看:247
本文介绍了重新发布:当iPhone连接到外部配件时,iOS修改App自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我早些时候问过这个问题,但是由于不清楚或细节不足而被关闭.希望我已经更好地解释了.在这里.

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

我正在构建一个iOS应用程序,该应用程序使用专有协议(通过iAP)与外部附件进行通信.我知道,通过在info.plist文件中添加唯一的协议名称,可以在将iOS设备连接到外部附件时使该应用程序自动启动(我知道也需要外部附件设备的支持).

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).

能够与外部附件通信的应用程序应在其Info.plist文件中声明其支持的协议.声明对特定协议的支持可使系统知道在连接该附件时可以启动您的应用程序.如果没有应用程序支持所连接的附件,则系统可以选择启动App Store并指出支持该功能的应用程序.

在我的应用程序中,我希望为用户提供图形界面,以启用或禁用自动启动应用程序.在后台,这需要将协议名称设置为预定义的值以启用它,或清除它以禁用它.

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.

如果有人可以给我有关如何以编程方式修改协议ID的信息,我将不胜感激.

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

推荐答案

要在连接支持的外部附件时自动加载应用, 我们需要在Info.plist中放入两件事:

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

  1. 受支持的外部附件协议

  1. Supported external accessory protocols

Item 0          yourCompanyProtocol

  • 应用程序不在后台运行

  • Application does not run in background

    YES
    

  • 这篇关于重新发布:当iPhone连接到外部配件时,iOS修改App自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆