Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Implementing Multi-User Support
Although Mobile SDK implements the underlying functionality, multi-user switching isn’t initialized at runtime unless and until your app calls one of the following APIs:
- Android native (UserAccountManager class methods)
- public void switchToUser(UserAccount user)
- public void switchToNewUser()
- iOS native (SFUserAccountManager class methods)
- - (void)switchToUser:(SFUserAccount *)newCurrentUser
- - (void)switchToNewUser
- Hybrid (JavaScript method)
- switchToUser
To let the user switch to a different account, launch a selection screen from a button, menu, or some other control in your user interface. Mobile SDK provides a standard multi-user switching screen that displays all currently authenticated accounts in a radio button list. You can choose whether to customize this screen or just show the default version. When the user makes a selection, call the Mobile SDK method that launches the multi-user flow.
- Push Notifications (if your app supports them)
- SmartStore Soups (if your app uses SmartStore)
- Account Management
Push Notifications Tasks
- Registers push notifications at login
- Unregisters push notifications at logout
- Delivers push notifications
- Differentiates notifications according to the target user account
- Launches the correct user context to display each notification
SmartStore Tasks
- Creates a separate SmartStore database for each authenticated user account
- Switches to the correct backing database each time a user switch occurs
- Refreshes its cached credentials, such as instances of SmartStore held in memory, after every user switch or logout