Inherits from NSObject
Declared in RSClient.h

Overview

This is the main class in the Retention Science iOS SDK.

Tasks

User Identification

Environments

Location

Initialization

Tracking

Properties

environment

The environmental mode the SDK should run in. This will determine which API endpoint is used. The default value is RSKitEnvironmentProduction.

@property enum RSKitEnvironment environment

See Also

Declared In

RSClient.h

locationManager

Expose a CLLocationManager instance to the RSClient. The most recent location updates, if there are any, will be included with subsequent tracking messages. RSKit will never start or stop location updates on its own.

@property CLLocationManager *locationManager

Discussion

Note: Optional.

Declared In

RSClient.h

userId

An identifying string for the current user.

@property NSString *userId

Declared In

RSClient.h

Class Methods

enableDebugLogs

Enables verbose logs for debugging purposes.

+ (void)enableDebugLogs

Declared In

RSClient.h

initializeWithSiteId:

Initialize the singleton RSClient instance with your Retention Science site ID.

+ (void)initializeWithSiteId:(NSString *)siteId

Parameters

siteId

The unique site ID provided to you by Retention Science.

Discussion

Warning: siteId must not be nil.

Declared In

RSClient.h

sharedClient

Accessor for the singleton RSClient instance.

+ (instancetype)sharedClient

Return Value

The singleton RSClient instance.

Discussion

Warning: Make sure you have called initializeWithSiteId: before call this.

Declared In

RSClient.h

Instance Methods

setSessionId:expiresIn:

Assigns an arbitrary session ID, as well as an expiration interval, which will be included in all subsequent tracking messages. The session ID is persisted to disk and is retained until the expiration interval is exceeded.

- (void)setSessionId:(NSString *)sessionId expiresIn:(NSTimeInterval)interval

Parameters

sessionId

The session ID, such as an offer code.

interval

Interval that session ID is retained for.

Declared In

RSClient.h

track:properties:

Tracks an action, as well as associated properties. The tracking message will be queued and posted to the RS API when the queue is automatically flushed.

- (void)track:(NSString *)action properties:(NSDictionary *)properties

Parameters

action

The name of the action you want to track.

properties

Arbitrary properties that are associated with this action.

Declared In

RSClient.h