I'm working on firmware for an MFI device and when the user plug in his device I can test if he has a specific app. However, if he doesn't have it I would like to open App Store and show him the application so he can download it.
I cannot figure out how to do that. Any ideas or links to docs that can help?
开发者_开发百科Yours
/peterThis is from the developer docs at this link.
Declaring the Protocols Your Application Supports 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.
To declare the protocols your application supports, you must include the UISupportedExternalAccessoryProtocols key in your application’s Info.plist file. This key contains an array of strings that identify the communications protocols that your application supports. Your application can include any number of protocols in this list and the protocols can be in any order. The system does not use this list to determine which protocol your application should choose; it uses it only to determine if your application is capable of communicating with the accessory. It is up to your code to choose an appropriate communications protocol when it begins talking to the accessory.
So as long as your app and your device have the same external accessory protocol, you shouldn't have to do anything to get that behavior.
精彩评论