Callbacks
  • 09 Jan 2025
  • 1 Minute à lire
  • Sombre
    Lumière
  • PDF

Callbacks

  • Sombre
    Lumière
  • PDF

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

When App Shielding performs security checks, it can either be configured to exit the application when a security problem is detected (e.g., [exitOnHookingFrameworks]), or it can be configured to notify the application via a callback. By handling the callback, you can, for instance, inform the user about the possible security threat.

Delegate callbacks currently occur when the application registers an observer with the PRMShieldEventManager class from the Shield SDK during application launch, and when the application is moved to the foreground.

Follow these steps to implement callbacks:

To implement callbacks

  1. Ensure the required security feature is enabled in the configuration (e.g., check Jailbreak) and that the feature is not configured to exit the application when this security problem is detected (e.g., exitOnJailbreak).

  2. Add the App Shielding framework to your project. For more information, see Adding the framework.

  3. Import the ShieldSDK/Shield.h umbrella header into any Objective-c source files that will interact with the callback APIs.

  4. Create a class that implements the PRMShieldEventDelegate protocol defined in ShieldEvent.h.

    This protocol defines delegate methods that, when implemented, are called when different security checks are finished. These callback functions are explained below. Note that the delegate methods are triggered on the main thread so it is possible to perform UI operations directly from the delegate methods.

  5. Lastly, register an object of the class implementing the PRMShieldEventDelegate protocol by calling the (void)addObserver: method of the PRMShieldEventManager class.

    This registration should be performed as early as possible because many security checks are performed right after the application has launched. Ideally, the registration is performed in the didFinishLaunchingWithOptions method of the application delegate.

Observers can also be removed with the removeObserver method of the PRMShieldEventManager API. However, App Shielding retains observers that were added with the legacy ShieldCallbackManager API indefinitely. They cannot be removed, and their callbacks remain active for as long as the application is running.


Cet article vous a-t-il été utile ?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, facilitant la découverte de connaissances grâce à l’intelligence conversationnelle