Latest 1.4.0
Homepage https://github.com/Brytecore/brytescore-ios
License MIT
Platforms ios 8.0
Authors

Lead Booster Analytics

brytescore-ios

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.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

brytescore-ios is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "BrytescoreAPI"

Objective-C

When importing into an Objective-C project, include the following at the top of the Podfile for your target.

use_frameworks!

Import BrytescoreAPI

Swift

    import BrytescoreAPI

Objective-C

    @import BrytescoreAPI;

Methods

Initialization

Sets the API key.
Generates a new unique session ID.
Retrieves the saved user ID, if any.

  • parameter {string} The API key.

Swift

    let _apiManager = BrytescoreAPIManager(apiKey: "<api-key>")

Objective-C

    BrytescoreAPIManager *apiManager = [[BrytescoreAPIManager alloc] initWithApiKey: @"<api-key>"];

getAPIKey

Returns the current API key

  • returns: The current API key

Swift

    _apiManager.getAPIKey()

Objective-C

    [apiManager getAPIKey];

load

Function to load json packages.

  • parameter {string} The name of the package.

Swift

    _apiManager.load(package: "realestate")

Objective-C

    [apiManager loadWithPackage:@"realestate"];

devMode

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.

Swift

    _apiManager.devMode(enabled: devMode)

Objective-C

    [apiManager devModeWithEnabled: devMode];

debugMode

Sets debug mode.
Log events are suppressed when debug mode is off.

  • parameter enabled: If true, then debug mode is enabled.

Swift

    _apiManager.debugMode(enabled: debugMode)

Objective-C

    [apiManager debugModeWithEnabled: debugMode];

impersonationMode

Sets impersonation mode.
Bypasses sending information to the API when impersonating another user.

  • parameter enabled: If true, then impersonation mode is enabled.

Swift

    _apiManager.impersonationMode(enabled: impersonationMode)

Objective-C

    [apiManager impersonationModeWithEnabled: impersonationMode];

validationMode

Sets validation mode.
Adds a validation attribute to the data for all API calls.

  • parameter enabled: If true, then validation mode is enabled.

Swift

    _apiManager.validationMode(enabled: validationMode)

Objective-C

    [apiManager validationModeWithEnabled: validationMode];

brytescore

Start tracking a property specific to a loaded package.

  • parameter property: The property name
  • parameter data: The property tracking data

Swift

    _apiManager.brytescore(property: propertyName, data: propertyData)

Objective-C

    [apiManager brytescoreWithProperty: propertyName data: propertyData];

pageView

Start a pageView.

  • parameter data: The pageView data.
  • data.isImpersonating
  • data.pageUrl
  • data.pageTitle
  • data.referrer

Swift

    _apiManager.pageView(data: [:])

Objective-C

    [apiManager pageViewWithData: [NSDictionary dictionary]];

registeredAccount

Sends a new account registration event.

  • parameter data: The registration data.
  • data.isImpersonating
  • data.userAccount.id

Swift

    _apiManager.registeredAccount(data: registrationData)

Objective-C

    [apiManager registeredAccountWithData: registrationData];

submittedForm

Sends a submittedForm event.

  • parameter data: The chat data.
  • data.isImpersonating

Swift

    _apiManager.submittedForm(data: submittedFormData)

Objective-C

    [apiManager submittedFormWithData: submittedFormData];

startedChat

Sends a startedChat event.

  • parameter data: The form data.
  • data.isImpersonating

Swift

    _apiManager.startedChat(data: startedChatData)

Objective-C

[apiManager startedChartWithData: startedChatData];

updatedUserInfo

Updates a user’s account information.

  • parameter data: The account data.

Swift

    _apiManager.updatedUserInfo(data: updatedUserInfoData)

Objective-C

    [apiManager updatedUserInfoWithData: updatedUserInfoData];

authenticated

Sends a user authentication event.

  • parameter data: The authentication data.
  • data.isImpersonating
  • data.userAccount
  • data.userAccount.id

Swift

    _apiManager.authenticated(data: authenticatedData)

Objective-C

    [apiManager authenticatedWithData: authenticatedData];

killSession

Kills the session.

Swift

    _apiManager.killSession()

Objective-C

    [apiManager killSession];

Latest podspec

{
    "name": "BrytescoreAPI",
    "version": "1.4.0",
    "summary": "Track user behavior and score their engagment with the Brytescore API.",
    "description": "brytescore-ios is the open-source iOS SDK that connects your app with the Brytescore API. The Brytescore API allows you to track your users' behavior and score their engagement.",
    "homepage": "https://github.com/Brytecore/brytescore-ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "emilyemorehouse": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Brytecore/brytescore-ios.git",
        "tag": "1.4.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "BrytescoreAPI/**/*"
}

Pin It on Pinterest

Share This