Hybrid APIs

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

SFAccountManagerPlugin Methods 

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

1cordova.require("com.salesforce.plugin.sfaccountmanager").logout();
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.

We've Moved

Welcome to the new home of the Mobile SDK Developer Guide! For now, the Japanese guide can be found in PDF form.