BridgeSDK Class Reference

Inherits from NSObject
Declared in BridgeSDK.h
BridgeSDK.m

+ setup

Set up the Bridge SDK based on settings passed in a configuration object.

+ (void)setup

Discussion

This is and setupWithBridgeInfo: are now the preferred methods for initializing the Bridge SDK. All other methods are deprecated.

This method searches the main bundle for a plist resource with the filename BridgeInfo.plist and merges its contents with a second (optional) plist called BridgeInfo-private.plist. The resulting dictionary of settings is used to set up the SBBBridgeInfo shared object.

See SBBBridgeInfoProtocol for a description of the keys and values for these plists. If not specified, environment defaults to SBBEnvironmentProd, and cacheDaysAhead and cacheDaysBehind default to 0 (BridgeSDK caching disabled). You only need to specify appGroupIdentifier if you’ve set up an app group under your target’s Capabilities in Xcode, and you want BridgeSDK to use that shared space.

Declared In

BridgeSDK.h

+ setupWithBridgeInfo:

Set up the Bridge SDK based on settings passed in a configuration object.

+ (void)setupWithBridgeInfo:(nonnull id<SBBBridgeInfoProtocol>)info

Parameters

info

An object of a class that conforms to SBBBridgeInfoProtocol containing the desired configuration settings.

Discussion

This is and setup are now the preferred methods for initializing the Bridge SDK. All other methods are deprecated.

Declared In

BridgeSDK.h

+ sharedUserDefaults

Get the UserDefaults suite being used by BridgeSDK. This will either be the suite with the appGroupIdentifier name, or if no appGroupIdentifier was specified in the setup info object, then this will be standardUserDefaults.

+ (nonnull NSUserDefaults *)sharedUserDefaults

Declared In

BridgeSDK.h

+ appConfig

Get the AppConfig for this app/platform/version/etc. as retrieved from the Bridge study.

+ (nullable SBBAppConfig *)appConfig

Discussion

When the Bridge study has been set up by calling setup or setupWithBridgeInfo:, the appropriate AppConfig will be retrieved from Bridge. Until that request has succeeded for the first time, this value will be nil. Once retrieved, it will be cached (in User Defaults if BridgeSDK is configured not to use caching) and the cached value will be used until the current value is retrieved from Bridge.

Declared In

BridgeSDK.h

+ setErrorUIDelegate:

Set a delegate to handle presenting appropriate UI to the study participant in case of “not consented” (412) and “app version not supported” (410) error responses from Bridge.

+ (void)setErrorUIDelegate:(nullable id<SBBBridgeErrorUIDelegate>)delegate

Parameters

delegate

An object that conforms to the SBBBridgeErrorUIDelegate protocol to handle UI for Bridge “not consented” (412) and “app version not supported” (410) error responses.

Declared In

BridgeSDK.h

  activityManager

Get the currently-registered activityManager.

@property (class, nonnull, nonatomic) id<SBBActivityManagerProtocol> activityManager

Discussion

If no activityManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  authManager

Get the currently-registered authManager.

@property (class, nonnull, nonatomic) id<SBBAuthManagerProtocol> authManager

Discussion

If no authManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  bridgeInfo

Get the shared BridgeInfo object.

@property (class, nonnull, nonatomic, readonly) id<SBBBridgeInfoProtocol> bridgeInfo

Discussion

If BridgeSDK has not yet been set up, all the fields will be blank.

Declared In

BridgeSDK.h

  consentManager

Get the currently-registered consentManager.

@property (class, nonnull, nonatomic) id<SBBConsentManagerProtocol> consentManager

Discussion

If no consentManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  notificationManager

Get the currently-registered notificationManager.

@property (class, nonnull, nonatomic) id<SBBNotificationManagerProtocol> notificationManager

Discussion

If no notificationManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  OAuthManager

Get the currently-registered OAuthManager.

@property (class, nonnull, nonatomic) id<SBBOAuthManagerProtocol> OAuthManager

Discussion

If no OAuthManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  objectManager

Get the currently-registered objectManager.

@property (class, nonnull, nonatomic) id<SBBObjectManagerProtocol> objectManager

Discussion

If no objectManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  participantManager

Get the currently-registered participantManager.

@property (class, nonnull, nonatomic) id<SBBParticipantManagerProtocol> participantManager

Discussion

If no participantManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  surveyManager

Get the currently-registered surveyManager.

@property (class, nonnull, nonatomic) id<SBBSurveyManagerProtocol> surveyManager

Discussion

If no surveyManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  studyManager

Get the currently-registered studyManager.

@property (class, nonnull, nonatomic) id<SBBStudyManagerProtocol> studyManager

Discussion

If no studyManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

  uploadManager

Get the currently-registered uploadManager.

@property (class, nonnull, nonatomic) id<SBBUploadManagerProtocol> uploadManager

Discussion

If no uploadManager has been registered, this will register a default manager and return that.

Declared In

BridgeSDK.h

+ setAuthDelegate:

This is a convenience method for setting the auth delegate on the default or currently-registered auth manager.

+ (void)setAuthDelegate:(nullable id<SBBAuthManagerDelegateProtocol>)delegate

Parameters

delegate

An object that conforms to SBBAuthManagerDelegateProtocol to serve as the auth delegate for the default or currently-registered auth manager.

Discussion

@unavailable The authDelegate is no longer available. Subscribe to kSBBUserSessionUpdatedNotification notification instead.

Declared In

BridgeSDK.h

+ setupWithStudy:cacheDaysAhead:cacheDaysBehind:

Set up the Bridge SDK for the given study and pointing at the production environment. Usually you would call this at the beginning of your AppDelegate’s application:didFinishLaunchingWithOptions: method. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study cacheDaysAhead:(NSInteger)cacheDaysAhead cacheDaysBehind:(NSInteger)cacheDaysBehind

Parameters

study

A string identifier for your app’s Bridge study, assigned to you by Sage Bionetworks.

cacheDaysAhead

Number of days ahead to cache.

cacheDaysBehind

Number of days behind to cache.

Discussion

This will register a default SBBNetworkManager instance configured correctly for the specified study and appropriate server environment. If you register a custom (or custom-configured) NetworkManager yourself, don’t call this method.

Caching is turned off if cacheDaysAhead = 0 AND cacheDaysBehind = 0

Declared In

BridgeSDK.h

+ setupWithStudy:useCache:

Convenience method for setting up the study with default caching for days ahead and days behind. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study useCache:(BOOL)useCache

Parameters

study

A string identifier for your app’s Bridge study, assigned to you by Sage Bionetworks.

useCache

A flag indicating whether to use the SDK’s built-in persistent caching. Pass NO if you want to handle this yourself.

Discussion

If useCache is set to YES then this method sets up caching using SBBDefaultCacheDaysAhead and SBBDefaultCacheDaysBehind

Declared In

BridgeSDK.h

+ setupWithStudy:

Convenience method for setting up the study with caching turned off (default). (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study

Parameters

study

A string identifier for your app’s Bridge study, assigned to you by Sage Bionetworks.

Declared In

BridgeSDK.h

+ setupWithStudy:cacheDaysAhead:cacheDaysBehind:environment:

Set up the Bridge SDK for the given study and server environment. Usually you would only call this version of the method from test suites, or if you have a non-DEBUG build configuration that you don’t want running against the production server environment. Otherwise call the version of the setupWithStudy: method that doesn’t take an environment parameter, and let the SDK use the default environment. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study cacheDaysAhead:(NSInteger)cacheDaysAhead cacheDaysBehind:(NSInteger)cacheDaysBehind environment:(SBBEnvironment)environment

Parameters

study

A string identifier for your app’s Bridge study, assigned to you by Sage Bionetworks.

cacheDaysAhead

Number of days ahead to cache.

cacheDaysBehind

Number of days behind to cache.

environment

Which server environment to run against.

Discussion

This will register a default SBBNetworkManager instance conigured correctly for the specified environment and study. If you register a custom (or custom-configured) NetworkManager yourself, don’t call this method.

Caching is turned off if cacheDaysAhead = 0 AND cacheDaysBehind = 0

Declared In

BridgeSDK.h

+ setupWithStudy:environment:

For backward compatibility only. Use setup: or setupWithBridgeInfo: instead. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study environment:(SBBEnvironment)environment

Declared In

BridgeSDK.h

+ setupWithStudy:useCache:environment:

For backward compatibility only. Use setup: or setupWithBridgeInfo: instead. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithStudy:(nonnull NSString *)study useCache:(BOOL)useCache environment:(SBBEnvironment)environment

Declared In

BridgeSDK.h

+ setupWithAppPrefix:

For backward compatibility only. Use setup: or setupWithBridgeInfo: instead. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithAppPrefix:(nonnull NSString *)appPrefix

Declared In

BridgeSDK.h

+ setupWithAppPrefix:environment:

For backward compatibility only. Use setup: or setupWithBridgeInfo: instead. (Deprecated: For backward compatibility only. Use setup: or setupWithBridgeInfo: instead.)

+ (void)setupWithAppPrefix:(nonnull NSString *)appPrefix environment:(SBBEnvironment)environment

Declared In

BridgeSDK.h