Skip to content

Multi User

mobile development kit client now supports multi-user login capability. This means a mobile development kit client app on a device can now securely be shared across multiple users. Features such as adding a new user, switching between user sessions, searching for a particular user are supported by the client.

To enable multi-user mode use one of the following option:

Option 1 - Enable Multi-User Setting in BrandedSettings.json

This is available for all versions of the client.

  1. Enable Multi-User setting in BrandedSettings.json. This enables multi-user settings at the client side and initializes the constructs required to support multi-user.

  2. Enable the flag Allow Upload of Pending Changes from Previous User for the app in the mobile services cockpit. In CF this flag is available in Mobile Settings Exchange feature under Shared Devices section. In Neo this flag is available in Client Policies feature under Shared Devices section. This flag ensures that any pending offline changes from previous user are securely uploaded to the service back end. This is especially vital when the previous user has not uploaded the offline changes and app is being switched to a new user.

  3. The client must be rebuilt after enabling the above settings.

  4. Once the client on the device is updated, user must reset the client and login again.

Option 2 - Setting User Mode via Settings Exchange and QR Code

This option is only available for client version 6.3 or newer and Cloud Foundry mobile services.

  1. Enable the flag Allow Upload of Pending Changes from Previous User for the app in the mobile services cockpit. In CF this flag is available in Mobile Settings Exchange feature under Shared Devices section. This flag ensures that any pending offline changes from previous user are securely uploaded to the OData service. This is especially vital when the previous user has not uploaded the offline changes, and the app is being switched to a new user.

  2. Open the client app and scan the QR Code generated under APIs > In-app Scanning Code in the mobile services cockpit.

Multi-user parameter in the generated QR code is either set to true or false based on the flag Allow Upload of Pending Changes from Previous User. The client will set the user mode based on the scanned QR code. Users can dynamically switch between user modes by scanning the QR code.

Note

For an existing single user app it is required to rebuild the client with above mentioned setting and enabling the flag in mobile services cockpit. Once the client on a device is updated the user will have to reset the client and re-login before multi-user capability can be enabled.

Along with above mentioned capabilities, here are some more features which can be used while implementing multi-user capabilities:

  • SkipReset flag in Logout action - If set to true the invocation of Logout action will redirect the user to Sign-In screen, by re-entering the passcode user can re-login and can start using the app. In a multi-user scenario each user may want to logout before they hand over the device to a different user. Default value of this flag is false which means the app would be reset clearing stored credentials such as passcode or Touch ID, authentication token, Offline Store. It is recommended to set this flag to true in a multi-user scenario.

  • OnUserSwitch - This event is raised when the user is switched in Multi-User mode and all the pending Offline OData transactions from previous user are successfully synced.

  • isAppInMultiUserMode client API determines if the application is in single or multi user mode. This helps to invoke different action depending on the mode for example Logout action with SkipReset set to true can be invoked in multi-user mode and Logout action with SkipReset set to false can be invoked in single user mode.

While implementing multi-user capabilities, one more aspect you need to consider is the support of push notification in the application. For more information on the best practices for push notification in multi-user mode, see Push Notification for Multi User.

Offline Sync Issue Handling During Multi-User Switching

When a user switches in multi-user mode, the mobile development kit attempts to upload the previous user's pending offline OData transactions before initializing the store for the new user. If this upload fails, the Transaction Issue screen is shown.

By default, the only option available on the Transaction Issue screen is to return to the sign-in screen so the previous user can sign back in and resolve the issue manually.

Configuring Conflict Handling in mobile services

When Offline Conflict Handling is enabled in mobile services, a conflict-handling button appears alongside Return to Sign In Screen on the Transaction Issue screen. To enable this:

  1. In the SAP mobile service cockpit, navigate to your application.
  2. Under Shared Devices, enable Allow Upload of Pending Changes from Previous User.
  3. Enable Offline Conflict Handling in Multi-User Mode.
  4. Select the desired conflict resolution mode:
    • Discard Pending Transactions — discards the previous user's pending transactions immediately.
    • Discard Pending Transactions After Upload — uploads a snapshot of the previous user's offline data to the server for potential administrator recovery, and then discards the pending transactions.

Runtime Behavior

When the user taps the conflict-handling button, a confirmation dialog appears before the action is applied. On confirmation:

  • The selected conflict resolution policy is applied.
  • The app proceeds directly to the new user's main page — no sign-in is required.

If the user dismisses the dialog or taps Return to Sign In Screen, no conflict resolution is applied and the previous user can sign back in to resolve the issue manually.

Customizing the Uploaded Snapshot

This section applies to the Discard Pending Transactions After Upload mode only.

The snapshot uploaded to the server can be customized via OfflineOptions.MultiUserConflictHandling in the .service file:

"OfflineOptions": {
  "MultiUserConflictHandling": {
    "UploadEncryptionKey": "/App/Rules/GenKey.js",
    "UploadRequestQueueOnly": true
  }
}
Property Default Description
UploadEncryptionKey None — must be provided Required. Key used to encrypt the uploaded snapshot. May be a literal string or a rule path (.js) that returns the key. If omitted, the upload action is blocked with an alert.
UploadRequestQueueOnly true Optional. true uploads only the request queue; false uploads both the entity store and the request queue.

The block is re-evaluated on every confirmed user switch.

To upload the store, the Offline Store Upload policy must be enabled in the mobile services app offline configuration. The uploaded offline store can be downloaded from the mobile services offline configuration and inspected using the ILOData tool.

Customizing the Transaction Issue Screen Strings

All strings on the Transaction Issue screen and the confirmation dialog can be overridden via OnboardingCustomizations in BrandedSettings.json. When not set, mode-specific default strings are used.

Key Default
offlineTransactionIssueScreenToolbarTitleString Sync Failed
offlineTransactionIssueScreenTitleString Transaction Issue
offlineTransactionIssueScreenSubTitle1String There are unresolved transactions on this device from:
offlineTransactionIssueScreenSubTitle2String Mode-specific default
offlineTransactionIssueScreenButtonString Return to Sign In Screen
offlineConflictButtonString Mode-specific default (Discard Pending Transactions or Upload Pending Transactions)
offlineConflictConfirmTitleString Confirm Conflict Handling
offlineConflictConfirmMessageString Mode-specific default
offlineConflictConfirmProceedButtonString Proceed
offlineConflictConfirmCancelButtonString Cancel

Recommendations

  • Use a rule reference for UploadEncryptionKey rather than a static string, so the key is generated at runtime and is not visible in app metadata.
  • The UploadEncryptionKey rule runs outside any page context and before the store is opened for the new user. Keep the rule focused on key generation only — avoid UI interactions, OData reads, or anything requiring an active page or open store.

Tutorial

Enable Multi-User Mode for Mobile Development Kit Application.


Last update: September 15, 2026