Quickstart

CocoaPods

Splitforce’s library is simple for developers to install. If you’re not a developer, find one and send them this link: http://splitforce.com/resources/quickstart#ios-cocoapods.

Want to see it in action? Check out our SplitPong iOS project on GitHub.

Step 1: Install CocoaPods

CocoaPods is a simple way to install libraries for your iOS app. If you don’t want it, see the manual installation. To install, open a terminal and type the following commands:

sudo gem install cocoapods
pod setup

Step 2: Add pod 'Splitforce' to the end of your Podfile.

If you don’t have one, create a file called Podfile with that row in it and place it next to your project.

Step 3: Type pod install into your terminal.

An Xcode Workspace file will be generated next to your project – open it.

Step 4: Open Your AppDelegate.m and paste:

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Splitforce/SFKit.h>
#endif

Create an account to get an app token.

Questions? Talk to someone smart and get answers – shoot us an email at hello@splitforce.com.

iOS

Splitforce’s library is simple for developers to install. If you’re not a developer, find one and send them this link: http://splitforce.com/resources/quickstart#ios-manual.

Want to see it in action? Check out our SplitPong iOS project on GitHub.

Step 1: Download

Sign up to download the library.

Step 2: Install

Drag and drop the Splitforce.framework file into your Xcode project’s framework directory:

iOS App Testing Quickstart - Splitforce Dashboard

Reference the Splitforce header in your header file:

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Splitforce/SFKit.h>
#endif

Make sure that you’re in debug mode. You can also shake your device to force different variations in debug mode using 'Shake To Variation'.

Step 3: Setup a Goal

Goals are the key metrics you measure to determine whether changes that you are testing are leading to improvements. You can learn more about Goal Types here.

To start tracking your own Goals, copy this code snippet to where the goal event occurs in your app:

SFVariation *variation = [SFManager.currentManager variationForExperimentNamed:@"experimentName"];
[variation goalResultNamed:@"Goal Reached"];
[variation variationEnded];
        

Step 4: Setup an Element

Elements are things in your app that you decide to change and test. You can learn more about Element Types here.

To create your own Element, copy and customize this code snippet to where the Element appears in your app:

[[SFManager currentManager] experimentNamed:@"experimentName"
                        applyVariationBlock:^(SFVariation *variation) {

    NSNumber *ballSize = variation.variationData[@"ballSize"];

    // Configuration for 'aiSpeed'
    NSNumber *aiSpeed = variation.variationData[@"aiSpeed"];

    <# Configure your object with the variation data #>
} applyDefaultBlock:^(NSError *error) {
    if (error) NSLog(@"Splitforce Error: %@", error);
    <#Configure your Object with Default Data#>
}];
        

Questions? Talk to someone smart and get answers – shoot us an email at hello@splitforce.com.

Android

Splitforce’s library is simple for developers to install. If you’re not a developer, find one and send them this link: http://splitforce.com/resources/quickstart#android.

Step 1: Download

Sign up to download the library.

Step 2: Install

For Android Studio:

- Copy the AndroidSplitForce.jar file into your libs directory and add the library to your project

- Add the following to your build.gradle:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
}
        

Make sure that you’re in debug mode.

For Eclipse:

- Copy the AndroidSplitForce.jar file into your libs directory and add the library to your project

- Add the external .jar to your project properties

Android App Testing Quickstart - Splitforce Dashboard

- Add the following permissions to your AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

Step 3: Setup a goal

Goals are the key metrics you measure to determine whether changes that you are testing are leading to improvements. You can learn more about Goal Types here.

To start tracking your own Goals, copy this code snippet to where the goal event occurs in your app:

SfVariation variation = SplitforceManager.getInstance().getExperiment("experimentName");

if (variation != null)
{
    variation.trackRateGoal("Goal Reached");
}
        

Step 4: Setup an Element

Elements are things in your app that you decide to change and test. You can learn more about Element Types here.

To create your own Element, copy and customize this code snippet to where the Element appears in your app:

SplitforceManager.getInstance().initExperiment("experimentName", new SfListener() {
    @Override
    public void onInitExperiment(final SfVariation variation) {
        // Init the default/nil values of your test subjects
        String buttonText = "Default text";

        if (variation != null) {
            	// Configuration for 'buttonText'
                buttonText = variation.getData("buttonText").toString();
        }
    }
});
        

Questions? Talk to someone smart and get answers – shoot us an email at hello@splitforce.com.

Unity

Splitforce’s library is simple for developers to install. If you’re not a developer, find one and send them this link: http://splitforce.com/resources/quickstart#unity.

Want to see it in action? Check out our SplitPong Unity project on GitHub.

Step 1: Download

Sign up to download the library.

Step 2: Install

Unzip the UnitySplitforce.zip file into the ‘Assets’ folder of your Unity project’s Assets directory and initialize the library in your app delegate.

void  SplitforceInitialised(bool isFailed, Hashtable additionalData) {
  // Proceed with game steps
  // You can check if everything is correct
  if (isFailed) {
   if (additionalData.ContainsKey("errorMessage")) {
     // Log message
   }
  }
 }

UnitySplitForce.SFManager.Instance.initCallback = SplitforceInitialised;
UnitySplitForce.SFManager.Init("myAppId", "myAppPassword", new Hashtable() {
      {"isDebug", true}
});
        

Make sure that you’re in debug mode.

Step 3: Setup a Goal

Goals are the key metrics you measure to determine whether changes that you are testing are leading to improvements. You can learn more about Goal Types here.

To start tracking your own Goals, copy this code snippet to where the goal event occurs in your app:

UnitySplitForce.SFVariation v = UnitySplitForce.SFManager.Instance.getExperiment("experimentName");
  if (v != null) {
   v.trackGoal("Goal Reached");
   v.endVariation();
 }
        

Step 4: Setup an Element

Elements are things in your app that you decide to change and test. You can learn more about Element Types here.

To create your own Element, copy and customize this code snippet to where the Element appears in your app:

// Init the default/nil values of your test subjects
 string myCustom = "Default Value";
 UnitySplitForce.SFVariation v = UnitySplitForce.SFManager.Instance.initExperiment("My Experiment Name");

if (v != null) {
   // Configuration for 'buttonText'

   myCustom = v.VariationData("buttonText").DataToString();
 } else {
   // Configure your Object with Default Data
 }
        

Questions? Talk to someone smart and get answers – shoot us an email at hello@splitforce.com.