SFUserAccountManager Class
The SFUserAccountManager class provides methods to access authenticated accounts, add new
accounts, log out accounts, and switch between accounts.
To access the singleton SFUserAccountManager instance, send the following message:
1[SFUserAccountManager sharedInstance]Properties
| Property | Description |
|---|---|
| @property (nonatomic, strong) SFUserAccount *currentUser | The current user account. If the user has never logged in, this property may be nil. |
| @property (nonatomic, readonly) NSString *currentUserId | A convenience property to retrieve the current user's ID. This property is an alias for currentUser.credentials.userId. |
| @property (nonatomic, readonly) NSString *currentCommunityId | A convenience property to retrieve the current user's community ID. This property is an alias for currentUser.communityId. |
| @property (nonatomic, readonly) NSArray *allUserAccounts | An NSArray of all the SFUserAccount instances for the app. |
| @property (nonatomic, readonly) NSArray *allUserIds | Returns an array that contains all user IDs. |
| @property (nonatomic, copy) NSString *activeUserId | The most recently active user ID. If the user that’s specified by activeUserId is removed from the accounts list, this user may be temporarily different from the current user. |
| @property (nonatomic, strong) NSString *loginHost | The host to be used for login. |
| @property (nonatomic, assign) BOOL retryLoginAfterFailure | A flag that controls whether the login process restarts after it fails. The default value is YES. |
| @property (nonatomic, copy) NSString *oauthCompletionUrl | The OAuth callback URL to use for the OAuth login process. Apps can customize this property. By default, the property’s value is copied from the SFDCOAuthRedirectUri property in the main bundle. The default value is @"testsfdc:///mobilesdk/detect/oauth/done". |
| @property (nonatomic, copy) NSSet *scopes | The OAuth scopes that are associated with the app. |