Adding Exported Type UTIs Programmatically for In-

2019-08-18 22:23发布

问题:

I am wanting to have an In-App Purchase that allows my users to import files from emails and other apps. To do this, I need to add the Exported Type UTI key to my .plist file.

Problem is, I don't want to do this until the user has made the In-App Purchase. Once they do, then I want to allow this feature.

Is it possible to add the Exported Type UTI to my .plist programmatically? Or is there another preferred way to offer this functionality using In-App Purchasing?

回答1:

The info.plist is part of the app bundle, and thus is part of the code-signing. You can't change it once the app has been signed, as that would change the app's checksum.

So unfortunately what you want to do is not possible. Your best bet would be to have the UTI always in the plist and just alert the user when they try to open a file that they need to pay to have that feature enabled.