brytescore-objc is the open-source iOS SDK that connects your website with the Brytescore API. The Brytescore API allows you to track your users' behavior and score their engagement.
To run the example project, clone the repo, and run pod install
from the Example directory first.
brytescore-objc is available through CocoaPods. To install it, simply add the following line to your Podfile:
use_frameworks!
pod "BrytescoreObjcAPI"
Import brytescore-objc in your .h file.
@import BrytescoreObjcAPI;
Sets the API key. Generates a new unique session ID. Retrieves the saved user ID, if any.
- parameter {string} The API key.
BrytescoreAPIManager *apiManager = [[BrytescoreAPIManager alloc] initWithApiKey: @"<api-key>"];
Returns the current API key
- returns: The current API key
[apiManager getAPIKey];
Function to load json packages.
- parameter {string} The name of the package.
[apiManager load:@"realestate"];
Sets dev mode. Logs events to the console instead of sending to the API. Turning on dev mode automatically triggers debug mode.
- parameter enabled: If true, then dev mode is enabled.
[apiManager devMode:enabled];
Sets debug mode. Log events are suppressed when debug mode is off.
- parameter enabled: If true, then debug mode is enabled.
[apiManager debugMode:enabled];
Sets impersonation mode. Bypasses sending information to the API when impersonating another user.
- parameter enabled: If true, then impersonation mode is enabled.
[apiManager impersonationModeWithEnabled: enabled];
Sets validation mode. Adds a validation attribute to the data for all API calls.
- parameter enabled: If true, then validation mode is enabled.
[apiManager validationMode:enabled];
Start tracking a property specific to a loaded package.
- parameter property: The property name
- parameter data: The property tracking data
[apiManager brytescore:propertyName withData:data];
Start a pageView.
- parameter data: The pageView data.
- data.isImpersonating
- data.pageUrl
- data.pageTitle
- data.referrer
[apiManager pageView:data];
Sends a new account registration event.
- parameter data: The registration data.
- data.isImpersonating
- data.userAccount.id
[apiManager registeredAccount:data];
Sends a submittedForm event.
- parameter data: The chat data.
- data.isImpersonating
[apiManager submittedForm:data];
Sends a startedChat event.
- parameter data: The form data.
- data.isImpersonating
[apiManager startedChat:data];
Updates a user's account information.
- parameter data: The account data.
[apiManager updatedUserInfo:data];
Sends a user authentication event.
- parameter data: The authentication data.
- data.isImpersonating
- data.userAccount
- data.userAccount.id
[apiManager authenticated:data];
Kills the session.
[apiManager killSession];