Splitforce Unity
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Properties
UnitySplitForce.SFManager Class Reference

Main class of SplitForce library. Use it to initialise lib, start experiments, get variations for player More...

Inheritance diagram for UnitySplitForce.SFManager:

Public Types

enum  STATE {
  ERROR = -1, DEFAULT, INIT_BACKEND, INIT_JS,
  INIT
}
 

Public Member Functions

delegate void InitCompleted (bool isError, Hashtable additionalData)
 Optional callback after library has finished initialisation. You should wait with proceeding with you game until this callback is fired otherwise you may not have data available yet for player and player will end up in default cohorts. Suggest to put it in your first/loading scene where you can wait More...
 
void MessageFromIOS (string message)
 
void MessageFromIOSUnrelated (string message)
 
void ChooseGAPropertyForExperiment (String experimentName, ArrayList properties)
 
SFVariation initExperiment (string experimentName)
 
SFVariation getExperiment (string experimentName)
 Use this to get selected variation for experiment. More...
 
void setCustomTargeting (string fieldName, object value)
 When you define custom Segmentation/Targetting Conditions on the website, this allows you to target variations based on runtime data. More...
 

Static Public Member Functions

static void Init (string applicationId, string applicationKey)
 Init library with your app id and key More...
 
static void Init (string applicationId, string applicationKey, Hashtable options)
 Init library with your app id and key, with additional options for tuning Possible values in options

  • isTransientVariation [Deprecated] From 0.5.1, Debug mode automatically enables this option. bool. If true, every time you restart app you will pick a new variation Useful for testing.
  • userLanguage string. Language of variation to pick, passed as standard ISO code
  • isDebug bool. More log messages, disable for your production builds
  • skipCache bool. If true, every time app starts library will download all variation data from backend. Useful for testing, disable for production builds.
  • isPersistentDefaultCohorts bool. If set to true, in case there are issues with backend data (no connection, data not yet set in backend etc), user will be put in default cohort and kept there. By default, in case of problems, user will be reshuffled when data is available (you may want to have this option enabled if you don't want your user see different behaviours in game)
  • backendTimeout float. Has to be greater than 0. Time after which library will consider backend timeout and return error.
  • sampleRate float. Fraction of your users that will be taken into test. Must be between 0 and 1, exclusive
More...
 

Data Fields

const string VERSION = "0.5.1"
 
InitCompleted initCallback
 Callback to set More...
 

Properties

STATE currentState [get, set]
 Current state of library, useful if you want to do more advanced processing More...
 
static SFManager Instance [get]
 

Detailed Description

Main class of SplitForce library. Use it to initialise lib, start experiments, get variations for player

Member Function Documentation

SFVariation UnitySplitForce.SFManager.getExperiment ( string  experimentName)
inline

Use this to get selected variation for experiment.

Parameters
experimentName
Returns
SfVariation with timing tracking, null if experiment was not initiated
static void UnitySplitForce.SFManager.Init ( string  applicationId,
string  applicationKey 
)
inlinestatic

Init library with your app id and key

Parameters
applicationIdApplication identifier.
applicationKeyApplication key.
static void UnitySplitForce.SFManager.Init ( string  applicationId,
string  applicationKey,
Hashtable  options 
)
inlinestatic

Init library with your app id and key, with additional options for tuning Possible values in options

  • isTransientVariation [Deprecated] From 0.5.1, Debug mode automatically enables this option. bool. If true, every time you restart app you will pick a new variation Useful for testing.
  • userLanguage string. Language of variation to pick, passed as standard ISO code
  • isDebug bool. More log messages, disable for your production builds
  • skipCache bool. If true, every time app starts library will download all variation data from backend. Useful for testing, disable for production builds.
  • isPersistentDefaultCohorts bool. If set to true, in case there are issues with backend data (no connection, data not yet set in backend etc), user will be put in default cohort and kept there. By default, in case of problems, user will be reshuffled when data is available (you may want to have this option enabled if you don't want your user see different behaviours in game)
  • backendTimeout float. Has to be greater than 0. Time after which library will consider backend timeout and return error.
  • sampleRate float. Fraction of your users that will be taken into test. Must be between 0 and 1, exclusive

Parameters
applicationIdApplication identifier.
applicationKeyApplication key.
optionsAdditional options for tuning Manager.
delegate void UnitySplitForce.SFManager.InitCompleted ( bool  isError,
Hashtable  additionalData 
)

Optional callback after library has finished initialisation. You should wait with proceeding with you game until this callback is fired otherwise you may not have data available yet for player and player will end up in default cohorts. Suggest to put it in your first/loading scene where you can wait

Parameters
isErrorSimple flag to inform you if library had suceeded
additionalDataWill contain additional data, mostly "error" message in case of problems
SFVariation UnitySplitForce.SFManager.initExperiment ( string  experimentName)
inline

Start specified experiment. Things to remember:

  • if experiment has a winner, we will not track it
  • if you passed userLanguage in settings, we will try to use specific dataset
  • if there's no experiment (for example not in backend yet):
    • default: return null and retry next time
    • isPersistentDefaultCohorts == true: always return default cohort
  • you should init experiment only once, otherwise you will lose timing data
Parameters
experimentNameName configured in backend.
void UnitySplitForce.SFManager.setCustomTargeting ( string  fieldName,
object  value 
)
inline

When you define custom Segmentation/Targetting Conditions on the website, this allows you to target variations based on runtime data.

Parameters
fieldNameCustom Variation Targeting name
valueCustom Variation Targeting value

Field Documentation

InitCompleted UnitySplitForce.SFManager.initCallback

Callback to set

Property Documentation

STATE UnitySplitForce.SFManager.currentState
getset

Current state of library, useful if you want to do more advanced processing

SFManager UnitySplitForce.SFManager.Instance
staticget

Gives you singleton of Manager, creates GameObject that persist between scene loads


The documentation for this class was generated from the following file: