Hybrid APIs

Hybrid apps can enable multi-user support through Mobile SDK JavaScript APIs. These APIs reside in the SFAccountManagerPlugin Cordova-based module.

Before you call any of these methods, you need to load the sfaccountmanager plug-in. For example:

Method NameDescription
getUsersReturns the list of users already logged in.
getCurrentUserReturns the current active user.
logoutLogs out the specified user if a user is passed in, or the current user if called with no arguments.
switchToUserSwitches the application context to the specified user, or launches the account switching screen if no user is specified.

Hybrid apps don’t need to implement a receiver for the multi-user switching broadcast event. This handler is implemented by the SalesforceDroidGapActivity class.