SalesforceSDKManager Class Reference

Inherits from NSObject
Declared in SalesforceSDKManager.h

Overview

This class will manage the basic infrastructure of the Mobile SDK elements of the app, including the orchestration of authentication, screen lock displaying, and management of app backgrounding and foregrounding state.

Other Methods

+ setInstanceClass:

Class instance to be used to instantiate the singleton.

+ (void)setInstanceClass:(Class)className

Parameters

className

Name of instantiator class.

Declared In

SalesforceSDKManager.h

  )

Sets & Gets the app name being used by the analytics framework.

@property (class, nonatomic, strong) NSString *NS_SWIFT_NAME ( analyticsAppName )

Return Value

App name.

Declared In

SalesforceSDKManager.h

– deviceId

Returns a unique device ID.

- (NSString *)deviceId

Return Value

Device ID.

Declared In

SalesforceSDKManager.h

  appType

App type (native, hybrid or react native)

@property (nonatomic, readonly) SFAppType appType

Declared In

SalesforceSDKManager.h

  isDevSupportEnabled

Use this flag to indicate if the dev support dialog should be enabled in the APP

@property (nonatomic, assign) BOOL isDevSupportEnabled

Declared In

SalesforceSDKManager.h

  isLoginWebviewInspectable

Use this flag to indicate if the login webview should be inspectable (NB: only applies to iOS 16.4 and above)

@property (nonatomic, assign) BOOL isLoginWebviewInspectable

Declared In

SalesforceSDKManager.h

  URLCacheType

The type of cache used for the shared URL cache, defaults to kSFURLCacheTypeEncrypted.

@property (nonatomic, assign) SFURLCacheType URLCacheType

Declared In

SalesforceSDKManager.h

  useEphemeralSessionForAdvancedAuth

Use this flag to indicate if advanced authentication should use an ephemeral web session. Defaults to YES.

@property (nonatomic, assign) BOOL useEphemeralSessionForAdvancedAuth

Declared In

SalesforceSDKManager.h

  useWebServerAuthentication

Whether or not the app should use web server oauth flow in web view. If false, user-agent will be used.

@property (nonatomic, assign) BOOL useWebServerAuthentication

Declared In

SalesforceSDKManager.h

  useHybridAuthentication

Whether hybrid authentication flow should be used. Defaults to YES.

@property (nonatomic, assign) BOOL useHybridAuthentication

Declared In

SalesforceSDKManager.h

  customDomainInferencePattern

Detect use of “Use Custom Domain” input from login web view using the given regex. Example for a specific org: “^https:\/\/mobilesdk\.my\.salesforce\.com/\?startURL=%2Fsetup%2Fsecur%2FRemoteAccessAuthorizationPage\.apexp” For any my domain: “^https:\/\/[a-zA-Z0-9]+\.my\.salesforce\.com/\?startURL=%2Fsetup%2Fsecur%2FRemoteAccessAuthorizationPage\.apexp”

@property (nonatomic, copy, nullable) NSRegularExpression *customDomainInferencePattern

Declared In

SalesforceSDKManager.h

  blockSalesforceIntegrationUser

Sets authentication ability for Salesforce integration users. When true, Salesforce integration users will be prohibited from initial authentication and receive an error message. Defaults to NO.

@property (nonatomic, assign) BOOL blockSalesforceIntegrationUser

Declared In

SalesforceSDKManager.h

+ initializeSDK

Initializes the SDK.

+ (void)initializeSDK

Declared In

SalesforceSDKManager.h

+ initializeSDKWithClass:

Initializes the SDK. Class instance to be used to instantiate the sdkManager.

+ (void)initializeSDKWithClass:(Class)className

Declared In

SalesforceSDKManager.h

– getAppTypeAsString

app type as a string

- (NSString *)getAppTypeAsString

Return Value

app type as a string

Declared In

SalesforceSDKManager.h

– showDevSupportDialog:

Show dev support dialog

- (void)showDevSupportDialog:(UIViewController *)presentingViewController

Parameters

presentingViewController

The view controller currently presented.

Declared In

SalesforceSDKManager.h

– getDevActions:

The view controller currently presented.

- (NSArray<SFSDKDevAction*> *)getDevActions:(UIViewController *)presentedViewController

Parameters

presentedViewController

The view controller currently presented.

Return Value

Dev actions (list of DevAction objects) to show in dev support dialog

Declared In

SalesforceSDKManager.h

– getDevSupportInfos

Dev info (list of name1, value1, name2, value2 etc) to show in SFSDKDevInfoController

- (NSArray<NSString*> *)getDevSupportInfos

Return Value

Dev info (list of name1, value1, name2, value2 etc) to show in SFSDKDevInfoController

Declared In

SalesforceSDKManager.h

– devInfoTitleString

Returns the title string of the dev support menu.

- (nonnull NSString *)devInfoTitleString

Return Value

Title string of the dev support menu.

Declared In

SalesforceSDKManager.h

– screenLockManager

Returns The ScreenLockManager instance.

- (id<SFScreenLockManager>)screenLockManager

Return Value

The Screen Lock Manager.

Declared In

SalesforceSDKManager.h

– biometricAuthenticationManager

Returns The BiometricAuthenticationManager instance.

- (id<SFBiometricAuthenticationManager>)biometricAuthenticationManager

Return Value

The Biometric Authentication Manager.

Declared In

SalesforceSDKManager.h

– useNativeLoginWithConsumerKey:callbackUrl:communityUrl:nativeLoginViewController:scene:

Creates the NativeLoginManager instance.

- (id<SFNativeLoginManager>)useNativeLoginWithConsumerKey:(nonnull NSString *)consumerKey callbackUrl:(nonnull NSString *)callbackUrl communityUrl:(nonnull NSString *)communityUrl nativeLoginViewController:(nonnull UIViewController *)nativeLoginViewController scene:(nullable UIScene *)scene

Parameters

consumerKey

The Connected App consumer key.

callbackUrl

The Connected App redirect URI.

communityUrl

The login url for native login

nativeLoginViewController

The view presented to the user and responsible for using the returned Native Login Manager to initiate either of the authorization code and credentials login flow or the headless, password-less login flow.

scene

Optional UIScene to enable multi-window support.

Return Value

The Native Login Manager.

Declared In

SalesforceSDKManager.h

– useNativeLoginWithConsumerKey:callbackUrl:communityUrl:reCaptchaSiteKeyId:googleCloudProjectId:isReCaptchaEnterprise:nativeLoginViewController:scene:

- (id<SFNativeLoginManager>)useNativeLoginWithConsumerKey:(nonnull NSString *)consumerKey callbackUrl:(nonnull NSString *)callbackUrl communityUrl:(nonnull NSString *)communityUrl reCaptchaSiteKeyId:(nullable NSString *)reCaptchaSiteKeyId googleCloudProjectId:(nullable NSString *)googleCloudProjectId isReCaptchaEnterprise:(BOOL)isReCaptchaEnterprise nativeLoginViewController:(nonnull UIViewController *)nativeLoginViewController scene:(nullable UIScene *)scene

– nativeLoginManager

Returns The NativeLoginManager instance.

- (id<SFNativeLoginManager>)nativeLoginManager

Return Value

The Native Login Manager.

Declared In

SalesforceSDKManager.h

Extension Methods

  sdkManagerFlow

@property (nonatomic, weak, nullable) id<SalesforceSDKManagerFlow> sdkManagerFlow

  snapshotViewControllers

@property (nonatomic, strong, nonnull) SFSDKSafeMutableDictionary<NSString*UIViewController*> *snapshotViewControllers

  nativeLoginViewControllers

@property (nonatomic, strong, nullable) SFSDKSafeMutableDictionary<NSString*UIViewController*> *nativeLoginViewControllers

– presentSnapshot:

- (void)presentSnapshot:(nonnull UIScene *)scene

– isSnapshotPresented:

- (BOOL)isSnapshotPresented:(nonnull UIScene *)scene

– dismissSnapshot:completion:

- (void)dismissSnapshot:(nonnull UIScene *)scene completion:(void ( ^ __nullable ) ( void ))completion