'iOS enable action extension programmatically

I would like to know if there is a way to enable action extension programmatically in containing app so that the user don't need to enable it manually.



Solution 1:[1]

It's been a long time since the question was asked, but FWIW here is the answer. Yes, I programmatically invoke an action extension by using undocumented NSExtension interface. I learned about this strategy from this post https://ianmcdowell.net/blog/nsextension/. This design is in fact very much usable and technically speaking it works perfectly for me, except for limitations imposed by extensions themselves, particularly memory limitations. For instance, my action extension is limited to 16 Mb, which in my case was very impactful.

Regarding the fact that NSExtension interface is not documented, I opened a source code level support case with Apple to help me implement my design and I asked them about the legitimacy of this interface. The answer was that it would be totally fine if I used it and it should not negatively affect Apple review.

The post I linked to above provided a very useful blueprint, but I had to put in quite a lot of additional code to come up with a working solution. If there is interest in how I did it, I can put together some shareable snippets and post them here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1