--- title: "Integrate the SDK APIs for the Automatic Configuration Update" slug: "oapps-ig-integrate-the-sdk-apis-for-the-automatic-configuration-update-702-703" updated: 2026-10-20T11:54:13Z published: 2026-10-20T11:54:13Z canonical: "docs.onespan.com/oapps-ig-integrate-the-sdk-apis-for-the-automatic-configuration-update-702-703" excludeFromSearch: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.onespan.com/llms.txt > Use this file to discover all available pages before exploring further. # Integrate the SDK APIs for the Automatic Configuration Update ## Android First, add the ShieldSDK-config Maven dependency to your Android project. This can be found in the SDK/maven/ directory of the App Shielding package. You can then use the ShieldConfig class with the following methods: | Methods for ShieldConfig class | | --- | | Method | Description | | requestUpdate() | Triggers App Shielding to download a configuration update. | | setUpdateCustomId(token) | Sets the X-update-custom-id header for configuration requests. The provided NSData is stored and used for any future request to the server. | | setUpdateCallbacks(callback) | Registers a listener that is invoked whenever the app downloads a configuration update. The callback receives a time stamp value that reflects the embedded time stamp from the downloaded configuration. | The following example demonstrates how these methods can be used: > ```plaintext > ShieldConfig.requestUpdate(); >            ShieldConfig.setUpdateCustomId("my-token".getBytes(StandardCharsets.UTF_8)); > >            ShieldConfig.setUpdateCallbacks(new UpdateCallbacks() { >            @Override >            public void configUpdateReceived(String timestamp) { >            // handle callback logic >            ... >            } >            }); > ``` > Always call these methods from a background thread as the app's main thread is reserved for updates of the user interface, as specified by Android. > ```plaintext > aBackgroundThread { >            ShieldConfig.requestUpdate(); >            ShieldConfig.setUpdateCallbacks(); >            ShieldConfig.setUpdateCustomId(); >            } > ``` > You should be aware that the downloaded new configuration is not applied immediately, but only after an application is restarted. ## iOS First, add the ShieldSDK.xcframework bundle from the App Shielding package to your iOS project. You can then use the ShieldConfig class with the following methods: | Methods for ShieldConfig class | | --- | | Method | Description | | requestUpdate | Triggers App Shielding to download a configuration update. | | setUpdateCustomId: | Sets the X-update-custom-id header for configuration requests. The provided NSData is stored and used for any future request to the server. | | setUpdateCallbacks: | Registers a listener that is invoked whenever the app downloads a configuration update. The callback receives a time stamp value that reflects the embedded time stamp from the downloaded configuration. | The following example demonstrates how these methods can be used: > ```plaintext > [ShieldConfig requestUpdate]; >            [ShieldConfig setUpdateCustomId:[NSData dataWithBytes:"my-token" length:8]]; > ``` For callbacks, you can start with the ConfigUpdateCallbacks interface. Objective-C example ```objectivec @interface ConfigUpdateCallbacks : NSObject        @end        @implementation ConfigUpdateCallbacks        - (void)configUpdateReceived:(NSString *)timestamp        {        // handle callback logic        ...        }        @end ``` During the app initialization (e.g., in didFinishLaunchingWithOptions), call the setUpdateCallbacks method in the following manner: ```plaintext [ShieldConfig setUpdateCallbacks:[[ConfigUpdateCallbacks alloc] init]]; ``` Swift example If you are using Swift instead of Objective-C, you can set up the callback as follows: > ```swift > class ConfigUpdateCallbacks: NSObject, ShieldConfigUpdateCallbacks { >            func configUpdateReceived(_ timestamp: String) { >            // handle callback logic >            ... >            } >            } >            ... >            ShieldConfig.setUpdateCallbacks(ConfigUpdateCallbacks()) > ``` > You should be aware that the downloaded new configuration is not applied immediately, but only after an application is restarted.