- 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
Integrating App Shielding into a framework
- Mis à jour le 22 Jan 2025
- 1 Minute à lire
- SombreLumière
- PDF
The normal use of App Shielding is to integrate it into an app to protect that app. It is also possible to add App Shielding to a framework, and then integrate this framework into an app. In this case, App Shielding is still protecting the app.
To use App Shielding from a framework, the first step is to set up the linking properly. This is exactly the same for App Shielding as for any other framework:
Link the framework to App Shielding, but do not embed App Shielding into the framework
Link the app to the framework, including embedding the framework into the app
Embed App Shielding into the app; linking the app to App Shielding is fine, but not necessary
At this point you should have a working app with an inactive App Shielding in it. You should be able to run the app, although none of App Shielding’s protections are working yet.
The next step is to activate App Shielding by running the the Shielding Tool on the app. Note that the Shielding Tool must be run on the app, not the framework. This is exactly the same as if App Shielding was integrated directly into the app. See the rest of this chapter for details on how to run the Shielding Tool. Both standalone command line mode and Xcode integration mode are supported.
Using App Shielding APIs from the framework works the same way as using them from the app. See Swift example from framework for one example.
It is possible for both the framework and the app to use App Shielding APIs at the same time. However, they will be using the same App Shielding instance, so any call to App Shielding from the app will equally affect the framework, and vice versa.