Skip to content

Print Data and Opening URLs Restriction

The SAP BTP SDK for Android has introduced print data and opening URLs restrictions. The print data restriction blocks the printing of data. This secures sensitive data from being compromised.

The opening URLs restriction blocks the opening of URLs in external browsers. This will also protect a user's data from potential malware applications and hackers.

Enable Policy

Admin can enable these two policies by enabling Restrict Print Data and Restrict Opening URLs in the Client Configuration tab under the Mobile Settings Exchange feature in mobile services cockpit.

Add AppManagementService

An app developer can leverage these two features by adding the AppManagementService instance to the SDKInitializer.start method.

val services = mutableListOf<MobileService>()
services.add(AppManagementService())
SDKInitializer.start(this, * services.toTypedArray())

AppManagementService will check the two policies configured in mobile services cockpit. If Restrict Print Data and Restrict Opening URLs are not enabled, adding AppManagementService will not have any effect in the client app.

Note

Client apps can still open mobile services onboarding or logout URLs in external browsers when the OAuth authentication option is set to CCT in flows.

If developers wish to bypass the opening URLs restriction, they can set the ALLOW_OPEN_URL extra property to true in the request intent. Then the URL can always be opened in an external browser.

import com.sap.cloud.mobile.foundation.common.ALLOW_OPEN_URL

val intent = Intent(Intent.ACTION_VIEW, Uri.parse("http://www.sap.com")).apply {
    putExtra(ALLOW_OPEN_URL, true)
}
startActivity(intent)

Last update: July 9, 2024