Application Versioning¶
The application versioning module controls which versions of a mobile app are valid (currently active) and are allowed to access mobile services.
The versioning module provides a flag that, when enabled using the mobile services cockpit, will only allow currently active application versions to be run and
forces end-users to update to the latest version of the mobile app from the public or internal app store.
Any request that does not contain the X-APP-VERSION
HTTP header or specifying an inactive version of the app is rejected with a 403 status code.
The developer sets the application version in the module-level build.gradle
file.
The SDK gets the version from the getApplicationVersion
method of SettingsParameters
and sets it in the X-APP-VERSION
HTTP header for every request to mobile services.
If the X-APP-VERSION
HTTP header is missing, the request is rejected with a 403 status code.
android {
defaultConfig {
versionName "1.0"
...
}
...
}
SettingsParameters settingsParameters = new SettingsParameters(application, appConfig);
AppHeadersInterceptor appHeadersInterceptor = new AppHeadersInterceptor(settingsParameters);
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addInterceptor(appHeadersInterceptor)
...
.build()
val settingsParameters = SettingsParameters(application, appConfig)
val appHeadersInterceptor = AppHeadersInterceptor(settingsParameters)
val okHttpClient = OkHttpClient.Builder()
.addInterceptor(appHeadersInterceptor)
...
.build()