brytescore-ios 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-ios is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BrytescoreAPI"
When importing into an Objective-C project, include the following at the top of the Podfile for your target.
use_frameworks!
import BrytescoreAPI
@import BrytescoreAPI;
Sets the API key. Generates a new unique session ID. Retrieves the saved user ID, if any.
- parameter {string} The API key.
let _apiManager = BrytescoreAPIManager(apiKey: "<api-key>")
BrytescoreAPIManager *apiManager = [[BrytescoreAPIManager alloc] initWithApiKey: @"<api-key>"];
Returns the current API key
- returns: The current API key
_apiManager.getAPIKey()
[apiManager getAPIKey];
Function to load json packages.
- parameter {string} The name of the package.
_apiManager.load(package: "realestate")
[apiManager loadWithPackage:@"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: devMode)
[apiManager devModeWithEnabled: devMode];
Sets debug mode. Log events are suppressed when debug mode is off.
- parameter enabled: If true, then debug mode is enabled.
_apiManager.debugMode(enabled: debugMode)
[apiManager debugModeWithEnabled: debugMode];
Sets impersonation mode. Bypasses sending information to the API when impersonating another user.
- parameter enabled: If true, then impersonation mode is enabled.
_apiManager.impersonationMode(enabled: impersonationMode)
[apiManager impersonationModeWithEnabled: impersonationMode];
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: validationMode)
[apiManager validationModeWithEnabled: validationMode];
Start tracking a property specific to a loaded package.
- parameter property: The property name
- parameter data: The property tracking data
_apiManager.brytescore(property: propertyName, data: propertyData)
[apiManager brytescoreWithProperty: propertyName data: propertyData];
Start a pageView.
- parameter data: The pageView data.
- data.isImpersonating
- data.pageUrl
- data.pageTitle
- data.referrer
_apiManager.pageView(data: [:])
[apiManager pageViewWithData: [NSDictionary dictionary]];
Sends a new account registration event.
- parameter data: The registration data.
- data.isImpersonating
- data.userAccount.id
_apiManager.registeredAccount(data: registrationData)
[apiManager registeredAccountWithData: registrationData];
Sends a submittedForm event.
- parameter data: The chat data.
- data.isImpersonating
_apiManager.submittedForm(data: submittedFormData)
[apiManager submittedFormWithData: submittedFormData];
Sends a startedChat event.
- parameter data: The form data.
- data.isImpersonating
_apiManager.startedChat(data: startedChatData)
[apiManager startedChartWithData: startedChatData];
Updates a user's account information.
- parameter data: The account data.
_apiManager.updatedUserInfo(data: updatedUserInfoData)
[apiManager updatedUserInfoWithData: updatedUserInfoData];
Sends a user authentication event.
- parameter data: The authentication data.
- data.isImpersonating
- data.userAccount
- data.userAccount.id
_apiManager.authenticated(data: authenticatedData)
[apiManager authenticatedWithData: authenticatedData];
Kills the session.
_apiManager.killSession()
[apiManager killSession];