NAV
Unity iOS Android Cocos2D-X

Introduction

On the high growth mobile games market, financial success depends heavily on the tuning if key in-game parameters: difficulty of stages, ad pressure, value of rewards, etc.
These parameters have huge impacts on retention and monetization.
But game tuning is complicated and tedious, analytics tools are complex to setup and they leave you to tune blindfolded.
Plus key metrics hits a ceiling: mobile players are very diverse, one size does not fit all!

askblu.ai is a Real-Time Player Personalization Platform for mobile games.
It simplifies and optimizes your game tuning, and increases your player retention and revenue.

askblu.ai offers currently 2 “off-the-shelf” personalization features:

Contact us if you want us to work on a personalization feature specific to your game.

In the askblu.ai web portal, you get all the metrics and funnels you need to compare the results with and without askblu.ai (click here for more information)

Check our GET STARTED web page to start putting Machine Learning at work on your games!

How askblu.ai works

askblu.ai learns from your players' behaviour, based on the events it receives from your game.

askblu.ai uses this (machine) learning to personalize in real time (in-game) some key parameters in your game.

1 - Difficulty tuning: Game flow, frustration and boredom

Players will remain in your game as long as they stay in their “flow” comfort zone, meaning in a well-being status, enjoying the gameplay, having fun.

askblu.ai goal here is to increase your players play time, detecting in real-time whether the current player ready to start a stage is getting frustrated/bored or is neither, and giving your game the corresponding answer: easier/default/harder so you can adapt the difficulty of the stage about to start.

2 - Interstitial Ad Pressure: tolerance and frustration

Players don’t have the same tolerance towards interstitial ads, they may enjoy your game but they will react differently if the ads are too intrusive or displayed at the wrong time.

askblu.ai goal is to optimize your interstitial ads revenue, detecting in real-time whether the current player is getting frustrated or is fine, and giving your game the corresponding answer: no/yes (don’t display / display) in order to optimize the overall number of ads displayed.

3 - Collecting events

askblu.ai is a full “plug&play” SaaS solution for Game and Level Designers, Developers, Producers, Data Analysts and Data Scientists.

You do not need to think about what data you have to send to the platform, we have two simple sets of events:

All data is completely anomynous and never shared, even between games (no IDFA or any other external player ID used).

4 - PlayerType and Automatic A/B testing

It is important for a studio to see what are the impacts of personalization on the game metrics. That’s why most metrics in the askblu portal are displayed in “A/B test” mode:

When a player starts a game for the first time they are given a PlayerType, BLU_player or REF_Player.
This PlayerType does not change through a normal player’s lifetime.

5 - Difficulty Personalization

Before a player starts a stage, you send the “askBLUDiff()” request, and the platform will answer in real time:

If the player is a BLU_Player:

If the player is a REF_player, the answer is always “ref”, which lets you either use the default difficulty or, if you have your own difficulty adjustment methods, use that.

If the are any connection problems and the answer is not received, the “default” or “ref” difficulty is always returned by the SDK, so there is no risk for the game.

6 - Ad Pressure Personalization

At any point in the game where you could display an interstitial ad to a player, you send the “askBLUAd()” request, and the platform will answer in real time:

=> Contact us to find out what personalization can be used in your game.

7 - Off-line behaviour

The SDK will continue working if a player loses network connection. Instead of being sent to the server, events will be stored by the SDK and will be sent when the network connection comes back.

If the device is off-line, the requests will always return a valid and safe answer:

Integration Overview

In your game, the player will advance from stage to stage and can win, lose or quit each stage.
The player might be able to suspend then resume the stage later, and you might offer a “save me!” feature.
In App Purchases, rewarded videos and full screen interstitial ads mays also be present.

BEST PRACTICE: integrate all the events that can be integrated in your game (based on your gameplay and monetization model), even if you only use one personalization request.

Here is a quick overview of how the SDK requests and events are integrated in a game.
You can read more details further in the documentation.

Quick reference guide

In all stages (levels) that the players can win, lose or giveup, use “stageStarted()” and “stageEnded()”.

If players are offered a “SaveMe” feature when they lose, use “saveMeUsed()”.

If players can suspend a stage then resume playing the stage later, use “stageSuspended()” and “stageResumed()”.

If the players can make In-App purchases, use “purchaseConfirmed()”.

If players can watch a rewarded video, use “rewardVideoWatched()”.

If you want to personalize the difficulty of a stage, use “askBLUDiff()” and “getBLUDiff()”.

If you display an interstitial ad without ad personalization, use “interstitialAdDisplayed()” and “interstitialAdTouched()”.

If you display an interstitial ad with ad personalization, use “askBLUAd()”, “getBLUAd()” and “interstitialAdTouched()”.

1 - Win/lose stage, no ads, no personalization

This is an example of a stage that the player can win or lose, with difficulty personalization but no interstitial ads displayed.

“stageStarted()” indicates that the player starts a stage.
“stageEnded()” indicates the result at the end of the stage.

1.1 - Case #1 with difficulty personalization

This is an example of a stage that the player can win or lose, with difficulty personalization but no interstitial ads displayed.

“askBLUDiff()” queries askblu.ai which difficulty should be set for a stage.
“getBLUDiff()” retrieves the difficulty answer from askblu.ai.

2 - Win/lose stage with Save Me, no ads, no personalization

This is an example of a stage that the player can win or lose + save me feature, with no interstitial ads displayed and no personalization.

“saveMeUsed()” indicates that the player chose to use the Save Me feature (in exchange of watching a rewarded video, some virtual currencies or something else).

2.1 - Case #2 with difficulty personalization

This is an example of a stage that the player can win or lose + save me feature, with difficulty personalization but no interstitial ads displayed.

3 - Win/lose stage with ads, no personalization

This is an example of a stage that the player can win or lose, with an interstitial ad displayed when the stage is completed, and no personalization.

“interstitialAdDisplayed()” indicates that an interstitial ad has been displayed in your game.
“interstitialAdTouched()” indicates that the player has touched the interstitial ad (optional if the detection is not available with your ad provider).

3.1 - Case #3 with difficulty personalization

This is an example of a stage that the player can win or lose, with an interstitial ad displayed when the stage is completed, and personalization.

3.2 - Case #3 with ad pressure personalization

This is an example of a stage that the player can win or lose, with an interstitial ad displayed when the stage is completed, and ad pressure personalization.

“askBLUAd()” queries askblu.ai whether the game should display (or not) an interstitial ad for the current player.
“getBLUAd()” retrieves the askBLUAd() answer from askblu.ai.

4 - Stage with suspend/resume and ads, no personalization

This is an example of a stage that the player can suspend/resume, with an interstitial ad displayed when the stage is suspended or completed.

“stageSuspended()” indicates that the player suspends a stage.
“stageResumed()” indicates that the player resumes the suspended stage.

4.1 - Case #4 with Difficulty personalization

This is an example of a stage that the player can suspend/resume, with an interstitial ad displayed when the stage is suspended or completed and with difficulty personalization.

4.2 - Case #4 with interstitial ads personalization

This is an example of a stage that the player can suspend/resume, with an interstitial ad displayed when the stage is suspended or completed and with ad pressure personalization.

Downloads

askbluai SDK version 1.5.7
The askblu.ai SDK is available for Unity (C#), XCode (ObjectiveC and C++) and Android Studio (Java).

Unity (C#)

The askblu.ai SDK supports Unity Editor 2018.2 or higher.

Download the askblu.ai Unity SDK, then select your programming language on the top left of the window and check how to start the askblu.ai SDK integration.

XCode (objC, C++)

Requires XCode 7.2 or higher
Apps must be compiled with iOS base SDK v9.2 or higher.
The askblu.ai SDK will work on devices with iOS 8.0 or higher.
NOTE: the SDK does NOT use Apple’s IDFA.

Download the askblu.ai objC SDK
or
Download the askblu.ai C++ SDK,
then select your programming language on the top left of the window and check how to start the askblu.ai SDK integration.

Android Studio (Java)

The android platform version should be at least 19

Download the askblu.ai Java SDK, then select your programming language on the top left of the window and check how to start the askblu.ai SDK integration.

Initialization

Step 1. Extract files from the SDK archive and import the askblu.ai SDK

Simply drag & drop the unity package in your Unity project and select “Import” to copy the package content to your Unity project.



A new entry “askblu.ai” will appear in the Window option of the Unity menu.



Step 2. Create the askblu.ai Configuration Script.

In the askblu.ai menu, select “Create askblu.ai Config Script”. It will create an askblu.ai configuration script in the Resources folder. The script will be used by the SDK to retrieve required information, we will show you how to edit that in the following steps.

Step 3. Get your application API key.

Go to your dashboard on the “askblu.ai portal”.
Select your application and go to the “Setup" tab. In the SDK Data section, click on the button “COPY TO CLIPBOARD”.



Step 4. Add your game key.

Open the askblu.ai Configuration Script created in the Step 2 and paste your game key in the apiKey field.

Step 5. Edit the isNewPlayer() method.

public static bool isNewPlayer()
{
    //WARNING! The following code will return true the first time askblu.ai is initialized
    //If you don't edit the code, all players will be considered new

    if (PlayerPrefs.GetInt(askbluai_Config.newInstallKey) == 0)
    {
        PlayerPrefs.SetInt(askbluai_Config.newInstallKey, 1);

        PlayerPrefs.Save();

        return true;
    }

    return false;
}

The “isNewPlayer()” method is an important method that must be edited correctly to differentiate new players and existing players.
New players are players that start playing the game for the first time. Existing players are players that have already played the game before the askblu.ai integration.

It must return “true” only if a player starts the game for the first time.
It must return “false” for the next sessions or if the player is an existing player.

If you don't edit the provided code, the player will be considered new the first time the askblu.ai SDK is initialized.

Open the askblu.ai Configuration Script and edit the “isNewPlayer()” method to add your own new player detection.



Step 6. Add the askblu.ai prefab.

askblu.ai needs to be initialized at the start of your game, to do so the askblu.ai prefab needs to be added in the first scene of your game.
Open your first scene then select in the askblu.ai menu “Create askblu.ai prefab”.
It will create an askblu.ai prefab in your current scene, it will initialize the SDK when you scene will run.

Step 1. Extract files from the SDK archive.

You will get a folder which contains three files :
- libaskbluai.a: the askblu.ai library
- askbluai.h: the askblu.ai API
- askbluai_Settings.h: structures that help to set methods parameters

Step 2. Add the askblu.ai folder to your XCode project.

Simply drag & drop the folder in your XCode project and select “Copy items if needed” to create a local copy of the files.

Step 3. Edit the target Build Settings.

Add the path to the askblu.ai library to the “Library Search Paths” setting



Add “-ObjC” to the “Other Linker Flags” setting



Step 4. Edit the target Build Phases.

Open the “Link Binary With Libraries” setting and check if the libaskbluai.a library appears in the list. If not, please add it.





Step 5. Get your application API key.

Go to your dashboard on the “askblu.ai portal”.
Select your application and go to the “Setup” tab. Go to the SDK Data section and click on the button “COPY TO CLIPBOARD”.



Step 6. Connect askblu.ai and the AppDelegate file.

#import “askbluaiCppIos.h”

1. Import the askblu.ai API header


2. Initialize the askblu.ai SDK in the applicationDidFinishLaunching method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   //Check if the player is a new player
   bool playerStatus = [self isNewPlayer];
   askbluai_Mode sdkMode = kaskbluai_Mode_RELEASE;
   NSString* apiKey = @PASTE_YOUR_ASKBLUAI_API_KEY_HERE;

   //Initialize the AskBLU library
   [libaskbluai initWithKey:apiKey withNewPlayer:playerStatus andSDKMode:sdkMode];

    return true;
}


askblu.ai needs to be initialized at the start of your game, to do so you must call the “initWithKey(String apiKey, bool playerStatus, askbluai_Mode sdkMode)” method as soon as your application starts.
Paste your API key in the designated field.

The boolean “playerStatus” is an important parameter that must be provided correctly to differentiate new players and existing players.
New players are players that start playing the game for the first time. Existing players are players that have already played the game before the askblu.ai integration.
It must be set to “true” only if a player starts the game for the first time.
It must be set to “false” for the next sessions or if the player is an existing player.
In the example you need to create your own “isNewPlayer” function to add your own new player detection.

The parameter “sdkMode” enables to choose one of the two operating modes for the SDK (askbluai_Mode_RELEASE or askbluai_Mode_DEBUG).
You must set the parameter to askbluai_Mode_RELEASE in a live version of your game. askblu.ai will only work if the value is set to askbluai_Mode_RELEASE.

The askbluai_Mode_DEBUG must never be used in a live version of your game. This mode enables to check if the askblu.ai SDK integration has been done correctly. You will be able to see on the dashboard if the events are sent. To know more about the Debug mode, check the detailed article.



3. Add the “suspend” event in the applicationDidEnterBackground method

- (void)applicationDidEnterBackground:(UIApplication *)application {

    [libaskbluai suspend];
}







4. Add the “resume” event in the applicationWillEnterForeground method

- (void)applicationWillEnterForeground:(UIApplication *)application {

    [libaskbluai resume];
}







Step 7. You are now ready to add requests and events.

You should now be able to build and run your project with askblu.ai working.

If there are compilation errors, please check that :
the “Base SDK” setting is iOS 9.2 or higher
the “iOS Deployment Target” is iOS 8.0 or higher

If you successfully started your app, you will see the message “askblu.ai initialization succeeded” in your console logs.
Otherwise you'll see “askblu.ai initialization failed, please, check your API key.”

Step 1. In the app folder of your android project, create a folder named “libs” and copy the askblu.ai android archive inside.

Step 2. Edit the build.gradle file of your app folder.

In the dependencies section, add the askblu.ai library.

dependencies {
    ...
    implementation (name: 'askbluai_and_java_lib', ext:'aar')
}







In the repositories section, add the path to your libs directory.

repositories {
    flatDir {
        dirs 'libs'
    }
}









Step 3. Check that the minSdkVersion parameter is 19 or higher..

Step 4. Get your application API key.

Go to your dashboard on the “askblu.ai portal”.
Select your application and go to the “Setup” tab. Go to the SDK Data section and click on the button “COPY TO CLIPBOARD”.



Step 5. Setup askblu.ai in your java activity file.

import fr.happybluefish.askbluaisdk.libaskbluai;
import fr.happybluefish.askbluaisdk.askbluai_PublicSettings;

1. Import the askblu.ai API header



2. Initialize the askblu.ai SDK in the “onCreate” method of your activity class

You must call the “initWithKey(String apiKey, bool playerStatus, askbluai_Mode sdkMode)” method as soon as your application starts.

protected void onCreate(Bundle savedInstanceState) {

  super.onCreate(savedInstanceState);

  boolean playerStatus = this.isNewPlayer();
  askbluai_PublicSettings.askbluai_Mode sdkMode = askbluai_PublicSettings.askbluai_Mode.RELEASE;  

  libaskbluai.initWithKey(this, PASTE_YOUR_ASKBLUAI_API_KEY_HERE,  playerStatus, sdkMode);
}

Paste your API key in the designated field.

The boolean “playerStatus” is an important parameter that must be provided correctly to differentiate new players and existing players.
New players are players that start playing the game for the first time. Existing players are players that have already played the game before the askblu.ai integration.
It must be set to “true” only if a player starts the game for the first time.
It must be set to “false” for the next sessions or if the player is an existing player.
In the example you need to create your own “isNewPlayer()” function to add your own new player detection.

The parameter “sdkMode” enables to choose one of the two operating modes for the SDK (askbluai_Mode_RELEASE or askbluai_Mode_DEBUG).
You must set the parameter to askbluai_Mode_RELEASE in a live version of your game. askblu.ai will only work if the value is set to askbluai_Mode_RELEASE.

The askbluai_Mode_DEBUG must never be used in a live version of your game. This mode enables to check if the askblu.ai SDK integration has been done correctly. You will be able to see on the dashboard if the events are sent. To know more about the Debug mode, check the detailed article.

3. Add the “resume” event in the “onResume” method of your activity class

protected void onResume() {

  super.onResume();

  libaskbluai.resume(this);
}









4. Add the “suspend” event in the “onPause” method of your activity class

protected void onPause() {

  super.onPause();

  libaskbluai.suspend(this);
}









Step 6. You are now ready to add requests and events.

If you successfully started your app, you will see the message “askblu.ai initialization succeeded” in your console logs.
Otherwise you'll see “askblu.ai initialization failed, please, check your API key.”

If your main code is written in C++, you may use a Java Native Interface (JNI) to call the askblu.ai Java SDK code.

Step 1. Extract files from the SDK archive.

You will get a folder which contains three files :
- libaskbluai.a: the askblu.ai library - askbluai.h: the askblu.ai API - askbluai_Settings.h: structures that help to set methods parameters

Step 2. Add the askblu.ai folder to your XCode project.

Simply drag & drop the folder in your XCode project and select “Copy items if needed” to create a local copy of the files.

Step 3. Edit the target Build Settings.

Add the path to the askblu.ai library to the “Library Search Paths” setting



Add “-ObjC" to the “Other Linker Flags" setting



Step 4. Edit the target Build Phases.

Open the “Link Binary With Libraries” setting and check if the libaskbluai.a library appears in the list. If not, please add it.





Step 5. Get your application API key.

Go to your dashboard on the “askblu.ai portal”.
Select your application and go to the “Setup” tab. Go to the SDK Data section and click on the button “COPY TO CLIPBOARD”.



Step 6. Connect askblu.ai and the AppDelegate file.

#import “askbluaiCppIos.h”

1. Import the askblu.ai API header



2. Initialize the askblu.ai SDK in the applicationDidFinishLaunching method

You must call the “initWithKey(String apiKey, bool playerStatus, askbluai_Mode sdkMode)” method as soon as your application starts.

bool AppDelegate::applicationDidFinishLaunching() {

   //Check if the player is a new player
   bool playerStatus = this->isNewPlayer();

   askbluai_Mode sdkMode = askbluai_Mode_RELEASE;


   //Initialize the AskBLU library
   askbluaiCppIos::initWithKey(PASTE_YOUR_ASKBLUAI_API_KEY_HERE, playerStatus, sdkMode);

    return true;
}

Paste your API key in the designated field.

The boolean “playerStatus” is an important parameter that must be provided correctly to differentiate new players and existing players.
New players are players that start playing the game for the first time. Existing players are players that have already played the game before the askblu.ai integration.
It must be set to “true” only if a player starts the game for the first time.
It must be set to “false” for the next sessions or if the player is an existing player.
In the example you need to create your own “isNewPlayer()” function to add your own new player detection.

The parameter “sdkMode” enables to choose one of the two operating modes for the SDK (askbluai_Mode_RELEASE or askbluai_Mode_DEBUG).
You must set the parameter to askbluai_Mode_RELEASE in a live version of your game. askblu.ai will only work if the value is set to askbluai_Mode_RELEASE.

The askbluai_Mode_DEBUG must never be used in a live version of your game. This mode enables to check if the askblu.ai SDK integration has been done correctly. You will be able to see on the dashboard if the events are sent. To know more about the Debug mode, check the detailed article.


3. Add the “suspend” event in the applicationDidEnterBackground method

void AppDelegate::applicationDidEnterBackground() {

   askbluaiCppIos::suspend();
}







4. Add the “resume” event in the applicationWillEnterForeground method

void AppDelegate::applicationWillEnterForeground() {

   askbluaiCppIos::resume();
}







Step 7. You are now ready to add requests and events.

You should now be able to build and run your project with askblu.ai working.

If there are compilation errors, please check that :
the “Base SDK” setting is iOS 9.2 or higher
the “iOS Deployment Target” is iOS 8.0 or higher

If you successfully started your app, you will see the message “askblu.ai initialization succeeded” in your console logs.
Otherwise you'll see “askblu.ai initialization failed, please, check your API key.”

Stage Events

stageStarted(stageTag, handicap)

askbluai.stageStarted(stageTag, handicap);
[libaskbluai stageStarted:@stageTag withHandicap:handicap];
libaskbluai.stageStarted(myActivity, stageTag, handicap);
askbluaiCppIos::stageStarted(stageTag, handicap);

Send a stageStarted event when the player decides to start playing the stage from the begining (not after a suspend).

To do this, call the “stageStarted(string stageTag, float handicap)” method.

If the difficulty request is used, the call should be done just after the “askBLUDiff()” request.

The “stageStarted() method must always be associated with a “stageEnded()” event.

The value of the parameter “stageTag” must be the same as the one used in the “askBLUDiff()” request.

The '“handicap”' parameter type is a float, its value must vary from 0 (no handicap) to 1 (maximum handicap). It is used to know if the players starts the stage with a handicap. For instance, if the player starts the stage with only 60% of its health bar, put “0.4” here.

stageEnded(result, how, helped)

float helpedVal = 0.2f;
...
if (stageEnded) {

   askbluai.stageEnded(askbluai_Result.SUCCEED, askbluai_How.NORMAL, helpedVal);
}
else {

   if (large) {

      askbluai.stageEnded(askbluai_Result.FAIL, askbluai_How.LARGE, helpedVal);
   }
   else if (close) {

      askbluai.stageEnded(askbluai_Result.FAIL, askbluai_How.CLOSE, helpedVal);
   }
   else {

      askbluai.stageEnded(askbluai_Result.FAIL, askbluai_How.NORMAL, helpedVal);
   }
}
float helpedVal = 0.2f;
...
if (playerWins) {

  [libaskbluai stageEndedWithResult:kaskbluai_Result_SUCCEED withHow:askbluai_How_NORMAL andHelped:helpedVal];
}
else {

   if (large) {

      [libaskbluai stageEndedWithResult:kaskbluai_Result_FAIL withHow:kaskbluai_How_LARGE andHelped:helpedVal];
   }
   else if (close) {

      [libaskbluai stageEndedWithResult:kaskbluai_Result_FAIL withHow:kaskbluai_How_CLOSE andHelped:helpedVal];
   }
   else {

      [libaskbluai stageEndedWithResult:kaskbluai_Result_FAIL withHow:kaskbluai_How_NORMAL andHelped:helpedVal];
   }
}

float helpedVal = 0.2f;
...

if (playerWins) {

   askbluai_PublicSettings.askbluai_Result result = askbluai_PublicSettings.askbluai_Result.SUCCEED;
   askbluaiCppIos::stageEnded(askbluai_Result_SUCCEED, askbluai_How_NORMAL, helpedVal);
   libaskbluai.stageEnded(myActivity, result, how, helpedVal);
}
else {

   askbluai_PublicSettings.askbluai_Result result = askbluai_PublicSettings.askbluai_Result.FAIL;
   if (large) {

      askbluai_PublicSettings.askbluai_How how = askbluai_PublicSettings.askbluai_How.LARGE;    libaskbluai.stageEnded(myActivity, result, how, helpedVal);
   }
   else if (close) {

      askbluai_PublicSettings.askbluai_How how = askbluai_PublicSettings.askbluai_How.CLOSE;    libaskbluai.stageEnded(myActivity, result, how, helpedVal);
   }
   else {

      askbluai_PublicSettings.askbluai_How how = askbluai_PublicSettings.askbluai_How.NORMAL;    libaskbluai.stageEnded(myActivity, result, how, helpedVal);
   }
}
float helpedVal = 0.2f;
...
if (playerWins) {

   askbluaiCppIos::stageEnded(askbluai_Result_SUCCEED, askbluai_How_NORMAL, helpedVal);
}
else {

   if (large) {

      askbluaiCppIos::stageEnded(askbluai_Result_FAIL, askbluai_How_LARGE, helpedVal);
   }
   else if (close) {

      askbluaiAskBLUCppIos::stageEnded(askbluai_Result_FAIL, askbluai_How_CLOSE, helpedVal);
   }
   else {

      askbluaiCppIos::stageEnded(askbluai_Result_FAIL, askbluai_How_NORMAL, helpedVal);
   }
}

Send a “stageEnded(askbluai_Result result, askbluai_How how, float helpedVal)” event when the player finishes the stage (not when suspending).
To do this, call the “stageEnded(askbluai_Result result, askbluai_How how, float helped)” method.
The “stageEnded” method must be called when the current stage is really finished (when the player wins, loses or leaves), it must be associated with a “stageStarted()” event.

It has three parameters:

The ‘result’ parameter type is askbluai_Result, it must be one of the following values:

The ‘how’ parameter type is askbluai_How, it must be one of the following values:

The ‘helped’ parameter type is a float, its value must vary from 0 (the player did not use any helpers) to 1 (the player used a helper that guaranteed winning the stage). For instance, if the player used a helper that gives a 50% chance to win, put “0.5” here.

We have defined 3 constants as an example, feel free to use them.

saveMeUsed()

askbluai.saveMeUsed();
[libaskbluai saveMeUsed];
libaskbluai.saveMeUsed(myActivity);
askbluaiCppIos::saveMeUsed();

This method is used when your player fails a stage but has an opportunity to continue (stage not lost yet), usually in exchange of some virtual currenvy, or wathcing a rewarded video ad.
If the player uses the save me, you must call “saveMeUsed()”, if he does not, you must call “stageEnded(askbluai_Result result, askbluai_How how, float helped)” as usual.

stageSuspended()

askbluai.stageSuspended();
[libaskbluai stageSuspended];
libaskbluai.stageSuspended(myActivity);
askbluaiCppIos::stageSuspended();

The “stageSuspended()” method is used only when your player can leave a stage before wining or loosing, and resume it later (in the same session or a new session).
Important: If the player can suspend a stage, you must save the “context” of this stage (advancement, position, points already won, etc), so when the player resumes it, you will use this context to setup the stage the way it was when suspended.
-> if the difficulty of this stage is personalized, you will also need to include in the context the answer that you got from askblu.ai (never resend a difficulty request for a stage a player resumes after a suspend. See “Overview” above).

stageResumed(stageTag, stageProgress)

askbluai.stageResumed(stageTag, stageProgress);
[libaskbluai stageResumed:stageTag withStageProgress:stageProgress];
libaskbluai.stageResumed(myActivity, stageTag, stageProgress);
askbluaiCppIos::stageResumed(stageTag, stageProgress);

The “stageResumed(string stageTag, float stageProgress)” method is used only when a player resumes a stage that he has previously suspended (the context has been saved and a stageSuspended() has been sent).

The ‘stageProgress’ parameter is a float whose value must be between 0 and 1.
0 if the player resumes a stage at the beginning of the stage,
1 if they are at the end of the stage.

Monetization Events

The reference value

To learn from your players' behaviour and personalize their experience, askblu.ai does not need to know the exact value that the in app purchases or ads bring to your studio.
All you have to do is:

Note: Each game can have a different reference value. For instance:

purchaseConfirmed(why, coef)

askbluai.purchaseConfirmed(askbluai_MAWhy.PROGRESS, 2);
[libaskbluai purchaseConfirmed:kaskbluai_MAWhy_PROGRESS withCoef:0.1f];
libaskbluai.purchaseConfirmed(myActivity, askbluai_PublicSettings.askbluai_MAWhy.VIRTUAL_CURRENCY, 1);
askbluaiCppIos::purchaseConfirmed(askbluai_MAWhy_NO_ADS, 0.5f);

The “purchaseConfirmed(askbluai_MAWhy why, float coef)” method is used when a purchase has been confirmed in the application
(IAP for the Apple Store, IAB for the Google Play Store).

It has two parameters:

The “why” parameter has four possible values:

rewardVideoWatched(why, coef)

askbluai.rewardVideoWatched(askbluai_MAWhy.PROGRESS, 1);
[libaskbluai rewardVideoWatched:kaskbluai_MAWhy_PROGRESS withCoef:1];
libaskbluai.rewardVideoWatched(myActivity, askbluai_PublicSettings.askbluai_MAWhy.PROGRESS, 1);
askbluaiCppIos::rewardVideoWatched(askbluai_MAWhy_PROGRESS, 1);

This method should be used after a player has finished watching an advertising video they chose to display to get a reward.

It has two parameters:

interstitialAdDisplayed(placement, coef)

askbluai.interstitialAdDisplayed(askbluai_Placement.MENU_IN, 1);
[libaskbluai interstitialAdDisplayed:kaskbluai_Placement_MENU_IN withCoef:1];
libaskbluai.interstitialAdDisplayed(myActivity, askbluai_PublicSettings.askbluai_Placement.MENU_IN, 1);
askbluaiCppIos::interstitialAdDisplayed(askbluai_Placement_MENU_IN, 1);

This method should be used just before an interstitial ad is displayed by the game (if there is no Ad Pressure personalization).
Interstitial ads are full-screen ads that covers the app’s interface.

There are two parameters:

The ‘placement’ parameter type is askbluai_Placement, it must be one of the following values:

interstitialAdTouched(placement)

askbluai.interstitialAdTouched(askbluai_Placement.MENU_IN);
[libaskbluai interstitialAdTouched:kaskbluai_Placement_MENU_IN];
libaskbluai.interstitialAdTouched(myActivity, askbluai_PublicSettings.askbluai_Placement.MENU_IN);
askbluaiCppIos::interstitialAdTouched(askbluai_Placement_MENU_IN);

This method should be used if the player touched an interstitial ad.

There is one parameter:

The ‘placement’ parameter type is askbluai_Placement, described above (see interstitialAdDisplayed())

Difficulty Request

askBLUDiff(stageTag)

Call the “askBLUDiff(string stageTag)” request as soon as the player decides to start a new stage (not resume a previously started stage).

askbluai.askBLUDiff(stageTag);
[libaskbluai askBLUDiff:@stageTag];
libaskbluai.askBLUDiff(myActivity, stageTag);
askbluaiCppIos::askBLUDiff(stageTag);

“askBLUDiff” is a request used to personalize each player experience. You can use it to know if the next stage should be easier, harder or be your defaut difficulty.

It has one parameter, “stageTag” which is the string identifier of the stage that is going to be played.

The askblu.ai library is non blocking, so the request system is separated in two steps: send the request first with “askBLUDiff”, then you get the returned answer with “getBLUDiff”.

getBLUDiff()

Get the askblu.ai answer to set the difficulty with “getBLUDiff”

askbluai_Diff answer = askbluai.getBLUDiff();
kaskbluai_Diff answer = [libaskbluai getBLUDiff];
askbluai_Diff answer = libaskbluai.getBLUDiff(myActivity);
askbluai_Diff answer = askbluaiCppIos::getBLUDiff();

The “getBLUDiff()” method will retrieve the result of the “askBLUDiff()” method so that you can adjust the difficulty of your next stage.
You have to leave a delay between the two calls so that the server has enough time to give a response.
We advise to call “askBLUDiff()” as soon as possible and “getBLUDiff()” as late as possible.

If the player is a BLU_Player (askblu.ai active for this player) the answer, whose type is askbluai_Diff, may have three different values:

If the player is a REF_Player (askblu.ai not active for this player), the answer is always askbluai_Diff_REF. The developer may use this answer if they want to have their custom settings for a stage difficulty, or set the default difficulty setting.

==» All metrics and funnels in the web portal will display data for BLU_Players and REF_Players.

The “getBLUDiff()” method will always return a valid answer. If the server didn’t respond in time or if the connection is lost, the askbluai_Diff_DEFAULT answer will be returned for BLU_Players and the askbluai_Diff_REF answer for REF_Players.

hasDiffAnswer() - (optional)

bool answerReady = askbluai.hasDiffAnswer();
BOOL answerReady = [libaskbluai hasDiffAnswer];
boolean answerReady = libaskbluai.hasDiffAnswer(myActivity);
bool answerReady = askbluaiCppIos::hasDiffAnswer();

If you used “askBLUDiff()” and you want to wait for the server answer before continuing, the method “hasDiffAnswer()” should be used to know if the server responded.
It will return true if the answer has been received, false otherwise.

Adapt your difficulty

Based on the askbluai.ai answer, select the difficulty level for the player.

The “getBLUDiff()” method can only be called once for an “askBLUDiff()” request. If you need to use the answer multiple times, you must save it in a variable, the answer will be deleted after the result is returned.

Only the answer of the last difficulty request is saved. There can only be one answer at the same time. If you start a second request without retrieving the first answer, the first answer will be lost.

Ad Pressure Request

Use this request if you display interstitial ads in your game, and you want to personalize the display to optimize revenues.

Important Use the request EVERYTIME you COULD display an interstitial ad. If you have your own rule to display or not an interstitial ad at a specific placement, the result (true or false) will be used as the “default” value (no answer from askblu.ai) and for the REF players (no personalization).

Calculate your own default decision

For the current placement, without askblu.ai, you decide to display or not an interstitial ad; that is the defaultAnswer.

askBLUAd(placement)

Call the “askBLUAd(askbluai_Placement placement)” request before you want to display a full screen interstitial advert to the player. askblu.ai will answer “true” or “false” in order to optimize the amount of adverts displayed to each player. The response is retrieved with the “getBLUAd(defaultAnswer)”.

It has one parameter:

The ‘placement’ parameter type is askbluai_Placement, see interstitialAdDisplayed() for the different values.

askbluai.askBLUAd(askbluai_Placement.MENU_IN);
[libaskbluai askBLUAd:kaskbluai_Placement_MENU_IN];
libaskbluai.askBLUAd(myActivity, askbluai_PublicSettings.askbluai_Placement.MENU_IN);
askbluaiCppIos::askBLUAd(kaskbluai_Placement_MENU_IN);

The askblu.ai library is non blocking, so the request system is separated in two steps: send the request first with “askBLUAd”, then you get the returned answer with “getBLUAd”.

getBLUAd(bool defaultAnswer, float coef)

Get the askblu.ai ad answer to display (or not) the interstitial ad to the player (askBLUAd() must have been called before).

bool answer = askbluai.getBLUAd(defaultAnswer, coef);
BOOL answer = [libaskbluai getBLUAd:defaultAnswer withCoef:coef];
boolean answser = libaskbluai.getBLUAd(myActivity, defaultAnswer, coef);
bool answer = askbluaiCppIos::getBLUAd(defaultAnswer, coef);

There are two parameters:

The “getBLUAd()” method will retrieve the result of the “askBLUAd()” method. It will return ‘true’ if you should display an interstitial ad, false otherwise.
You have to leave a delay between the two calls so that the server has enough time to give a response.
We advise to call “askBLUAd()” as soon as possible and “getBLUAd()” as late as possible.

If the player is a REF_Player (askblu.ai not active for this player) or the server didn’t respond in time or the connection is lost, the answer will always be your default answer.

==» All metrics and funnels in the web portal will display data for BLU_Players and REF_Players.

hasAdAnswer() - (optional)

bool answerReady = askbluai.hasAdAnswer();
BOOL answerReady = [libaskbluai hasAdAnswer];
boolean answerReady = libaskbluai.hasAdAnswer(myActivity);
bool answerReady = askbluaiCppIos::hasAdAnswer();

If you used “askBLUAd()” and you want to wait for the server answer before continuing, the method “hasAdAnswer()” should be used to know if the server responded.
It will return true if the answer has been received, false otherwise.

You can put this method in a loop, with a timeout, to give more time to the game to get the answer without blocking the game to much.

If you use the method “hasAdAnswer()”, and decide to stop waiting (timout expired) you still need to use the “getBLUAd()” method and act accordingly.

Display (or not) your interstitial ad

Based on the askbluai.ai ad answer, you must display an ad accordingly.

For each interstitial you want to display, you must call one “askBLUAd()” and one “getBLUAd()”.

Only the answer of the last ad pressure request is saved. There can only be one answer at the same time. If you start a second request without retrieving the first answer, the first answer will be lost.

Debug mode

The SDK Debug Mode enables to check if the askblu.ai SDK integration has been done correctly. It must never be used in a live version of your game.
You will be able get live feedbacks on the askblu.ai dashboard if events are sent from your application when you test it.

public static askbluai_Mode getSDKMode()
{
    return askbluai_Mode.DEBUG;
}

The set the SDK in Debug Mode, open the askblu.ai Configuration Script and edit the “getSDKMode()” method.

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_Mode mode)” method has a parameter called "mode".

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_Mode mode)” method has a parameter called "mode".

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_Mode mode)” method has a parameter called "mode".


You can select the operating mode for the SDK by changing the askbluai_Mode value:

Warning: askblu.ai solution will not be active with the SDK Debug Mode and will only work with the SDK Release Mode. The mode must always be set to RELEASE before submitting an application.

Activating the Debug Mode means that the SDK will now provide additional logs and give feedback on the correct SDK integration in your game.

On your game dashboard, go to the SDK Integration tab and check the SDK Debug Mode section.
When you play a game with the SDK Debug Mode enabled, the dashboard will be updated in real time with the SDK activity.

Moreover, you can also select a difficulty or ad setting you want to test.
For the ad pressure personalisation:
You just need to set the response desired and press update for it to be used when the next “getBLUAd()” is called.
For the difficulty personalisation:
If you select Easier, Default or Harder, click on the UPDATE button, the SDK will be affected immediately and will return the selected answer when “getBLUDiff()” is called.
If you select Ref or go from Ref to another difficulty setting, the change will be effective only after you restart your game.

Player Type

As expained above, each player is given a PlayerType at the first session, which will not change during their lifetime.

With the PlayerType it is possible to display most metrics in the askblu portail for:

For each game, we can set the percentage of new players becoming BLU_Players (this is done automatically by askblu):

Setting the player type

It is possible for a studio to set directly the PlayerType in the SDK, in order to work with an external A/B testing.

In this case, the first time a player starts your game, you can set manually if the player is a BLU player or a REF player so that they can match other A/B solutions you may be using.
Important, you should always keep a minimum amount of REF players (statistically significant) in order to compare the BLU / REF results.

To choose the player type behavior, open the askblu.ai Configuration Script and edit the “getPlayerTypeChoice()” method.

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_PlayerTypeChoice playerTypeChoice, askbluai_Mode mode)” method has a parameter called "playerTypeChoice".

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_PlayerTypeChoice playerTypeChoice, askbluai_Mode mode)” method has a parameter called "playerTypeChoice".

The “initWithKey(string apiKey, bool isNewPlayer, askbluai_PlayerTypeChoice playerTypeChoice, askbluai_Mode mode)” method has a parameter called "playerTypeChoice".


public static askbluai_PlayerTypeChoice getPlayerTypeChoice()
{
    return askbluai_PlayerTypeChoice.AUTO;
}

You can set the player type selection at initialization by changing the askbluai_PlayerTypeChoice value:

After the first launch of the game, the initial PlayerTypeChoice is kept and subsequent changes to the parameter will not be taken into account (as the player type must not change).

getPlayerType()

askbluai_PlayerType pType = askbluai.getPlayerType();
kaskbluai_PlayerType pType = [libaskbluai getPlayerType];
askbluai_PublicSettings.askbluai_PlayerType pType = libaskbluai.getPlayerType(myActivity);
askbluai_PlayerType pType = askbluaiCppIos::getPlayerType();

If you want to know the current player’s PlayerType, call the “getPlayerType()” method.
The returned values are:

Data collection

The Apple App Store game submission requests that you describe what type of data colletion your game is doing, inclusing the 3rd-party SDK that you integrate.

Here is what you need to answer for our askblu.ai SDK.

Our SDK collects data.

Usage: Product Interaction

We use NO contact, health & Fitness, financial, location, sensitive, Contacts or User Content information.

We use NO browsing history, search history, Indentifiers, Purchase information.

We use some Usage Data: for Product Interaction.

We use NO diagnostics or other data information.

Product Interaction: Analytics

We use Product Interaction data for Analytics purpose (you do not need to checck “Product Personalization” here).

The data we collect for product Interaction is NOT linked to the user’s identity.

No tracking purpose

Finaly, we do NOT use Product Interaction data for the purpose of Tracking data between apps (and we do NOT use the IDFA).

Summary

If we consider only the askblu.ai SDK, here is the summay you should get:

Release notes

Version 1.5.7 (8 September 2021)

Add a new parameter “playerTypeChoice” to the initWithKey(string apiKey, bool newPlayer, askbluai_Mode mode) event. It enables the developer to choose if the player will belong to the BLU cohort or not.
New method added: getPlayerType(). It can be used to know if the player is a BLU_Player or a REF_Player.

Warnings:
For the Unity SDK users, updating to the SDK version 1.5.7 will require to get the last version of the askbluai_Config.cs file. Save your previous configuration file and report the modifications done in the new file.
For other SDK users, updating to the 1.5.7 version will require to update the initWithKey method parameters to add the new parameter PlayerTypeChoice.

Version 1.5.6 (13 July 2021)

Add a new parameter “handicap” to the stageStarted(string stageTag, float handicap) event. It is used to know if the player started a stage with a handicap (for example, half of its health bar).

Version 1.5.5 (26 May 2021)

Fixed a bug in android version where the placement parameter was not sent to the server.

Version 1.5.4 (21 May 2021)

Add extra protection in case of a server error that could make the app crash on android devices.

Version 1.5.3 (13 Avril 2021)

Fix a bug that could create an error if hasDiffAnswer and hasAdAnswer were called if the SDK wasn’t initialized correctly.

Version 1.5.2 (12 Avril 2021)

Offline mode optimization.

Version 1.5.1 (11 March 2021)

New feature: ad pressure personalisation with askBLUAd(), hasAdAnswer() and getBLUAd().
New event added: stageSuspended(). It should be used when a player leaves a stage that he can resume later.
New event added: interstitialAdTouched(). It should be used when a player touches an advert.
hasRequestAnswer() has been renamed to hasDiffAnswer().
The custom type askbluai_PValue has been removed.
New Custom types added (askbluai_MAWhy, askbluai_Placement).
purchaseConfirmed(), rewardVideoWatched() and interstitialAdDisplayed() now requires new parameters.

Version 1.4.2 (7 January 2021)

Fixed a bug where events were may not be updated in the dashboard when using the SDK Debug Mode.
Removal of the SDK Mode “OFF”.

Version 1.4.1 (30 November 2020)

Performance Optimization.

Version 1.4.0 (30 September 2020)

New event added: interstitialAdDisplayed(). It should be used before an interstitial ad is displayed.
Android SDK migrated to AndroidX and target SDK platform changed from 28 to 29.

Version 1.3.0 (7 September 2020)

New events added: purchaseConfirmed() and rewardVideoWatched().
purchaseConfirmed() should be used after a purchase has been done by the player.
rewardVideoWatched() should be used after the player has finished watching a video they chose to display.
Unity SDK Integration updated. An askblu.ai menu has been added to the Unity Window tab to ease the Unity SDK Set up.

Version 1.2.5 (16 June 2020)

New SDK Mode: “OFF mode” will disable the SDK at initialization (for instance if you prefer to turn personalization off if the player does not give consent, knowing that we do not use any personal data, all the data we receive is anonymous).
Bug fixes with XCode 11.4 simulator.

Version 1.2.4 (16 April 2020)

Detection of the application version updated.

Version 1.2.3 (25 March 2020)

Some implementation problems will be detected and warnings will be shown in the console logs.

Version 1.2.2 (14 February 2020)

“stageRespawned” method renamed to “saveMeUsed”.

Version 1.2.1 (31 January 2020)

New feature: the SDK has now a Debug mode that can be set in the “initWithKey” method. The Debug mode must only be used to check the SDK integration with the Debug Mode on the dashboard. For more information, please visit the SDK Debug mode section.
Bug fixes.

Version 1.1.0 (15 January 2020)

An “askblu.ai initialization failed” message will be displayed in the logs if the api key provided is not valid.
Update (Unity only): the developer’s custom code in the class “askbluai_Setup” has been removed from the SDK to ease SDK updates (api key and new player detection). We provide an additional file to insert once in your project.
For more information, see the Unity SDK integration section.

Version 1.0.1 (8 January 2020)

Update: The enumerator askbluai_Helped type has been removed.
The askblu.ai “stageEnded” method now requires (askbluai_Result res, askbluai_How how, float helped). Changed from (askbluai_Result res, askbluai_How how, askbluai_Helped helped). The “helped” parameter should now be a float from 0 (no help) to 1 (guaranteed win for the player).
New feature: the askblu.ai “GetBLUDiff” method will return “askbluai_Diff_REF” if the current player is a BLU passive player. The developer may use this feature if they wish to use their own settings for a stage.

Version 1.0.0 (22 November 2019)

askblu.ai official release.
Updates and optimizations.
New feature: Internal test mode will enable to play the game with a chosen difficulty.

Version 0.10.5 (05 November 2019)

Bug fix, mandatory update.

Version 0.10.2 (29 August 2019)

Minor update.

Version 0.10.1 (4 August 2019)

Bug fix, mandatory update.

Version 0.10.0 (June 2019)

askblu.ai public release.

API Reference

Select a language tab to read the matching API Reference.

public static void initWithKey (string apiKey, bool isNewPlayer, askbluai_PlayerTypeChoice pTChoice, askbluai_Mode mode)

Initializes askblu.ai with an API Key and a player status.

Parameters:
apiKey - The askblu.ai API key of the game
isNewPlayer - Must be false if the player already played the game before askblu.ai integration, true otherwise
pTChoice - to set the player type automatically or manually
mode - the chosen operating mode for the SDK

public enum askbluai_PlayerTypeChoice
{

    AUTO = 0, //the player type is chosen by askblu.ai
    REF = 1, //the player won't be in the BLU cohort
    BLU = 2, //the player will be in the BLU cohort
};

public enum askbluai_Mode {

    RELEASE = 0, //enable the askblu.ai SDK
    DEBUG = 1,  //enable the SDK in Debug mode
};

Warning: askblu.ai will not be active in the SDK Debug Mode and will only work in the SDK Release Mode. The mode must always be set to RELEASE before submitting an application



public static void resume ()

Tells askblu.ai the application has entered foreground



public static void suspend ()

Tells askblu.ai the application has entered background



public static void stageStarted (string stageTag, float handicap)

Tells askblu.ai the player has started a stage

Parameters:
stageTag - the current stage's unique identifier
handicap - if the player starts the stage with a handicap, float from 0 (no handicap) to 1 (maximum handicap)


public static void saveMeUsed ()

Tells askblu.ai the player should have failed the stage but used a way to continue playing it



public static void stageEnded (askbluai_Result result, askbluai_How how, float helped)

Tells askblu.ai information about how the player ended the stage

Parameters:
result - the player result when the stage ended
how - how the player ended the stage, easily, normally or with difficulty
helped -  how the player was helped to finish the stage, from 0 (no helped) to 1 (guaranteed win for the player)

public enum askbluai_Result {

  FAIL = 0, //the player failed to clear the stage
  SUCCEED = 1, //the player cleared the stage
  GIVEUP = 2, //the player left the stage before he failed
  DRAW = 3, //the player didn't fail and didn't succeed
};

public enum askbluai_How {

  NORMAL = 0, //default choice
  CLOSE = 1, //the player almost won or lost
  LARGE = 2,  //the player easily won or lost by far
};



public static void stageResumed (string stageTag, float stageProgress)

Tells askblu.ai the player has resumed a stage in another session

Parameters:
stageTag - the current stage's unique identifier
stageProgress - value between 0 and 1 corresponding to the player's progression in the stage



public static void stageSuspended()

Tells askblu.ai the user has suspended a stage (that he can resume later)



public static void purchaseConfirmed(askbluai_MAWhy why, float coef)

Tells askblu.ai the player has made a purchase

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the purchase

public enum askbluai_MAWhy
{

    PROGRESS = 0, //when the purchase helps the player to progress
    VIRTUAL_CURRENCY = 1, //when the player purchases virtual currency
    NO_ADS = 2, //when the purchase enables to remove ads
    SAVE_ME = 3, //when the purchase enables the player to continue playing instead of losing
    OTHER = 4, //if none of the other choices match
};



public static void rewardVideoWatched(askbluai_MAWhy why, float coef)

Tells askblu.ai the player chose to watch a video to get a reward

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the reward video



public static void interstitialAdDisplayed(askbluai_Placement placement, float coef)

Tells askblu.ai an interstitial ad has been displayed

Parameters:
placement - the placement where the interstitial is displayed
coef - the reference value associated to the interstitial ad

public enum askbluai_Placement
{

    STARTUP = 0,
    HOME_IN = 1,
    HOME_OUT = 2,
    STAGE_IN = 3,
    STAGE_OUT = 4,
    MENU_IN = 5,
    MENU_OUT = 6,
    STORE_IN = 7,
    STORE_OUT = 8,
    ACHIEVEMENT_IN = 9,
    ACHIEVEMENT_OUT = 10,
    SETTINGS_IN = 11,
    SETTINGS_OUT = 12,
    IN_GAME = 13,
    PAUSE = 14,
    OTHER = 15,
};



public static void interstitialAdTouched(askbluai_Placement placement)

Parameters:
placement - the placement where the interstitial is displayed



public static void askBLUDiff (string stageTag)

Asks askblu.ai which difficulty should be used for a defined stage

Parameters:
stageTag - the unique identifier of the chosen stage



public static bool hasDiffAnswer ()

Checks if the SDK has received the response from askblu.ai
Returns true if the answer has been received, false otherwise



public static askbluai_Diff getBLUDiff ()

Gets the askblu.ai response
Returns the difficulty that needs to be set for the stage

public enum askbluai_Diff {

  DEFAULT = 0, //no need to change the difficulty
  EASIER = 1, //the player needs an easier difficulty
  HARDER = 2, //the player needs a harder difficulty
  REF = 3, //the player is a BLU passive player
};



public static void askBLUAd(askbluai_Placement placement)

Asks askblu.ai if an interstitial advert should be displayed

Parameters:
placement - the placement where the interstitial will be displayed



public static bool hasAdAnswer()

Checks if the askblu.ai response of the askBLUAd request has been retrieved from the server to the SDK
Returns true if the answer has been received, false otherwise



public static bool getBLUAd(bool defaultAnswer, float coef)

Gets the askblu.ai response of the askBLUAd request
Returns the advised difficulty returned by askblu.ai, true if an advert should be displayed, false otherwise

Parameters:
defaultAnswer - the answer returned if the server response has not been received
coef - the reference value associated to the reward video



public static askbluai_PlayerType getPlayerType()

Gets the type of the player to know if he is in the BLU cohort
Returns the type of the player (BLU, REF or PENDING)

public enum askbluai_PlayerType
{

    PENDING = 0, //the SDK has not finished initializing yet
    REF = 1, //the player is not in the BLU cohort
    BLU = 2, //the player is in the BLU cohort
};
public static void initWithKey (string apiKey, bool isNewPlayer, askbluai_PlayerTypeChoice pTChoice, bool askbluai_Mode mode)

Initializes askblu.ai with an API Key and a player status.

Parameters:
apiKey - The askblu.ai API key of the game
isNewPlayer - Must be false if the player already played the game before askblu.ai integration, true otherwise
pTChoice - to set the player type automatically or manually
mode - the chosen operating mode for the SDK

public enum askbluai_Mode {

    askbluai_Mode_RELEASE = 0, //enable the askblu.ai SDK
    askbluai_Mode_DEBUG = 1,  //enable the SDK in Debug Mode
};

public enum askbluai_PlayerTypeChoice
{
    askbluai_PlayerTypeChoice_AUTO = 0, //the player type is chosen by askblu.ai
    askbluai_PlayerTypeChoice_REF = 1,  //the player won't be in the BLU cohort
    askbluai_PlayerTypeChoice_BLU = 2 //the player will be in the BLU cohort
};

Warning: askblu.ai will not be active in the SDK Debug Mode and will only work in the SDK Release Mode. The mode must always be set to RELEASE before submitting an application



public static void resume ()

Tells askblu.ai the application has entered foreground



public static void suspend ()

Tells askblu.ai the application has entered background



public static void stageStarted (string stageTag, float handicap)

Tells askblu.ai the player has started a stage

Parameters:
stageTag - the current stage's unique identifier
handicap - if the player starts the stage with a handicap, float from 0 (no handicap) to 1 (maximum handicap)


public static void saveMeUsed ()

Tells askblu.ai the player should have failed the stage but used a way to continue playing it



public static void stageEnded (askbluai_Result result, askbluai_How how, float helped)

Tells askblu.ai information about how the player ended the stage

Parameters:
result - the player result when the stage ended
how - how the player ended the stage, easily, normally or with difficulty
helped -  how the player was helped to finish the stage, from 0 (no helped) to 1 (guaranteed win for the player)

public enum askbluai_Result {

    askbluai_Result_FAIL = 0, //the player failed to clear the stage
    askbluai_Result_SUCCEED = 1, //the player cleared the stage
    askbluai_Result_GIVEUP = 2, //the player left the stage before he failed
    askbluai_Result_DRAW = 3, //the player didn't fail and didn't succeed
};

public enum askbluai_How {

    askbluai_How_NORMAL = 0, //default choice
    askbluai_How_CLOSE = 1, //the player almost won or lost
    askbluai_How_LARGE = 2,  //the player easily won or lost by far
};



public static void stageResumed (string stageTag, float stageProgress)

Tells askblu.ai the player has resumed a stage in another session

Parameters:
stageTag - the current stage's unique identifier
stageProgress - value between 0 and 1 corresponding to the player's progression in the stage



public static void stageSuspended()

Tells askblu.ai the user has suspended a stage (that he can resume later)



public static void purchaseConfirmed(askbluai_MAWhy why, float coef)

Tells askblu.ai the player has made a purchase

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the purchase

enum askbluai_MAWhy {

    askbluai_MAWhy_PROGRESS = 0, //when the purchase helps the player to progress
    askbluai_MAWhy_VIRTUAL_CURRENCY = 1, //when the player purchases virtual currency
    askbluai_MAWhy_NO_ADS = 2, //when the purchase enables to remove ads
    askbluai_MAWhy_SAVE_ME = 3, //when the purchase enables the player to continue playing instead of losing
    askbluai_MAWhy_OTHER = 4 //if none of the other choices match
};



public static void rewardVideoWatched(askbluai_MAWhy why, float coef)

Tells askblu.ai the player chose to watch a video to get a reward

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the reward video



public static void interstitialAdDisplayed(askbluai_Placement placement, float coef)

Tells askblu.ai an interstitial ad has been displayed

Parameters:
placement - the placement where the interstitial is displayed
coef - the reference value associated to the interstitial ad

enum askbluai_Placement {

    askbluai_Placement_STARTUP = 0,
    askbluai_Placement_HOME_IN = 1,
    askbluai_Placement_HOME_OUT = 2,
    askbluai_Placement_STAGE_IN = 3,
    askbluai_Placement_STAGE_OUT = 4,
    askbluai_Placement_MENU_IN = 5,
    askbluai_Placement_MENU_OUT = 6,
    askbluai_Placement_STORE_IN = 7,
    askbluai_Placement_STORE_OUT = 8,
    askbluai_Placement_ACHIEVEMENT_IN = 9,
    askbluai_Placement_ACHIEVEMENT_OUT = 10,
    askbluai_Placement_SETTINGS_IN = 11,
    askbluai_Placement_SETTINGS_OUT = 12,
    askbluai_Placement_IN_GAME = 13,
    askbluai_Placement_PAUSE = 14,
    askbluai_Placement_OTHER = 15
};



public static void interstitialAdTouched(askbluai_Placement placement)

Parameters:
placement - the placement where the interstitial is displayed



public static void askBLUDiff (string stageTag)

Asks askblu.ai which difficulty should be used for a defined stage

Parameters:
stageTag - the unique identifier of the chosen stage



public static bool hasDiffAnswer ()

Checks if the SDK has received the response from askblu.ai
Returns true if the answer has been received, false otherwise



public static askbluai_Diff getBLUDiff ()

Gets the askblu.ai response
Returns the difficulty that needs to be set for the stage

public enum askbluai_Result {

    askbluai_Result_FAIL = 0, //the player failed to clear the stage
    askbluai_Result_SUCCEED = 1, //the player cleared the stage
    askbluai_Result_GIVEUP = 2, //the player left the stage before he failed
    askbluai_Result_DRAW = 3, //the player didn't fail and didn't succeed
};



public static void askBLUAd(askbluai_Placement placement)

Asks askblu.ai if an interstitial advert should be displayed

Parameters:
placement - the placement where the interstitial will be displayed



public static bool hasAdAnswer()

Checks if the askblu.ai response of the askBLUAd request has been retrieved from the server to the SDK
Returns true if the answer has been received, false otherwise



public static bool getBLUAd(bool defaultAnswer, float coef)

Gets the askblu.ai response of the askBLUAd request
Returns the advised difficulty returned by askblu.ai, true if an advert should be displayed, false otherwise

Parameters:
defaultAnswer - the answer returned if the server response has not been received
coef - the reference value associated to the reward video



public static askbluai_PlayerType getPlayerType()

Gets the type of the player to know if he is in the BLU cohort
Returns the type of the player (BLU, REF or PENDING)

public enum askbluai_PlayerType {

    askbluai_PlayerType_PENDING = 0,  //the SDK has not finished initializing yet
    askbluai_PlayerType_REF = 1, //the player is not in the BLU cohort
    askbluai_PlayerType_BLU = 2 //the player is in the BLU cohort
};
+ (void) initWithKey:(NSString*)apiKey withNewPlayer:(BOOL)isNewPlayer withPlayerTypeChoice:(kaskbluai_PlayerTypeChoice)pTChoice andSDKMode:(kaskbluai_Mode)mode

 Initializes askblu.ai with an API Key and a player status.

Parameters:
apiKey - The askblu.ai API key of the game
isNewPlayer - Must be false if the player already played the game before askblau.ai integration, true otherwise
pTChoice - to set the player type automatically or manually
mode - the chosen operating mode for the SDK

typedef NS_ENUM(NSInteger, kaskbluai_Mode)
{
    kaskbluai_Mode_RELEASE = 0, //enable the askblu.ai SDK
    kaskbluai_Mode_DEBUG = 1, //enable the SDK in Debug Mode
};

typedef NS_ENUM(NSInteger, kaskbluai_PlayerTypeChoice)
{
    kaskbluai_PlayerTypeChoice_AUTO = 0, //the player type is chosen by askblu.ai
    kaskbluai_PlayerTypeChoice_REF = 1,  //the player won't be in the BLU cohort
    kaskbluai_PlayerTypeChoice_BLU = 2 //the player will be in the BLU cohort
};

Warning: askblu.ai will not be active in the SDK Debug Mode and will only work in the SDK Release Mode. The mode must always be set to RELEASE before submitting an application



+ (void) resume

Tells askblu.ai the application has entered foreground



+ (void) suspend

Tells askblu.ai the application has entered background



+ (void) stageStarted:(NSString*)stageTag withHandicap:(float)handicap

Tells askblu.ai the player has started a stage

Parameters:
stageTag - the current stage's unique identifier
handicap - if the player starts the stage with a handicap, float from 0 (no handicap) to 1 (maximum handicap)


+ (void) saveMeUsed

Tells askblu.ai the player should have failed the stage but used a way to continue playing it



+ (void) stageEndedWithResult:(kaskbluai_Result)result withHow:(kaskbluai_How)how andHelped:(float)helped

Tells askblu.ai information about how the player ended the stage

Parameters:
result - the player result when the stage ended
how - how the player ended the stage, easily, normally or with difficulty
helped -  how the player was helped to finish the stage, from 0 (no helped) to 1 (guaranteed win for the player)

typedef NS_ENUM(NSInteger, kaskbluai_Result)
{

    kaskbluai_Result_FAIL = 0,    //the player failed to clear the stage
    kaskbluai_Result_SUCCEED = 1, //the player cleared the stage
    kaskbluai_Result_GIVEUP = 2,  //the player left the stage before he failed
    kaskbluai_Result_DRAW = 3,    //the player didn't fail and didn't succeed
};

typedef NS_ENUM(NSInteger, kaskbluai_How)
{
    kaskbluai_How_NORMAL = 0, //default choice
    kaskbluai_How_CLOSE = 1, //the player almost won or lost
    kaskbluai_How_LARGE = 2,  //the player easily won or lost by far
};



+ (void) stageResumed:(NSString*)stageTag withStageProgress:(float)stageProgress

Tells askblu.ai the player has resumed a stage in another session

Parameters:
stageTag - the current stage's unique identifier
stageProgress - value between 0 and 1 corresponding to the player's progression in the stage



+ (void) stageSuspended

Tells askblu.ai the user has suspended a stage (that he can resume later)



+ (void) purchaseConfirmed:(kaskbluai_MAWhy) why withCoef:(float)coef

Tells askblu.ai the player has made a purchase

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the purchase

typedef NS_ENUM(NSInteger, kaskbluai_MAWhy)
{
    kaskbluai_MAWhy_PROGRESS = 0, //when the purchase helps the player to progress
    kaskbluai_MAWhy_VIRTUAL_CURRENCY = 1, //when the player purchases virtual currency
    kaskbluai_MAWhy_NO_ADS = 2, //when the purchase enables to remove ads
    kaskbluai_MAWhy_SAVE_ME = 3, //when the purchase enables the player to continue playing instead of losing
    kaskbluai_MAWhy_OTHER = 4 //if none of the other choices match
};



+ (void) rewardVideoWatched:(kaskbluai_MAWhy) why withCoef:(float)coef

Tells askblu.ai the player chose to watch a video to get a reward

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the reward video



+ (void) interstitialAdDisplayed:(kaskbluai_Placement) placement withCoef:(float)coef

Tells askblu.ai an interstitial ad has been displayed

Parameters:
placement - the placement where the interstitial is displayed
coef - the reference value associated to the interstitial ad

typedef NS_ENUM(NSInteger, kaskbluai_Placement)
{
    kaskbluai_Placement_STARTUP = 0,
    kaskbluai_Placement_HOME_IN = 1,
    kaskbluai_Placement_HOME_OUT = 2,
    kaskbluai_Placement_STAGE_IN = 3,
    kaskbluai_Placement_STAGE_OUT = 4,
    kaskbluai_Placement_MENU_IN = 5,
    kaskbluai_Placement_MENU_OUT = 6,
    kaskbluai_Placement_STORE_IN = 7,
    kaskbluai_Placement_STORE_OUT = 8,
    kaskbluai_Placement_ACHIEVEMENT_IN = 9,
    kaskbluai_Placement_ACHIEVEMENT_OUT = 10,
    kaskbluai_Placement_SETTINGS_IN = 11,
    kaskbluai_Placement_SETTINGS_OUT = 12,
    kaskbluai_Placement_IN_GAME = 13,
    kaskbluai_Placement_PAUSE = 14,
    kaskbluai_Placement_OTHER = 15
};



+ (void) interstitialAdTouched:(kaskbluai_Placement) placement

Parameters:
placement - the placement where the interstitial is displayed



+ (void) askBLUDiff:(NSString*)stageTag

Asks askblu.ai which difficulty should be used for a defined stage

Parameters:
stageTag - the unique identifier of the chosen stage



+ (BOOL) hasDiffAnswer

Checks if the SDK has received the response from askblu.ai
Returns true if the answer has been received, false otherwise



+ (kaskbluai_Diff) getBLUDiff

Gets the askblu.ai response
Returns the difficulty that needs to be set for the stage

typedef NS_ENUM(NSInteger, kaskbluai_Diff)
{
    kaskbluai_Diff_DEFAULT = 0, //no need to change the difficulty
    kaskbluai_Diff_EASIER = 1, //the player needs an easier difficulty
    kaskbluai_Diff_HARDER = 2,  //the player needs a harder difficulty
    kaskbluai_Diff_REF = 3, //the player is a BLU passive player
};



+ (void) askBLUAd:(kaskbluai_Placement) placement

Asks askblu.ai if an interstitial advert should be displayed

Parameters:
placement - the placement where the interstitial will be displayed



+ (BOOL) hasAdAnswer

Checks if the askblu.ai response of the askBLUAd request has been retrieved from the server to the SDK
Returns true if the answer has been received, false otherwise



+ (BOOL) getBLUAd:(BOOL)defaultAnswer withCoef:(float) coef

Gets the askblu.ai response of the askBLUAd request
Returns the advised difficulty returned by askblu.ai, true if an advert should be displayed, false otherwise

Parameters:
defaultAnswer - the answer returned if the server response has not been received
coef - the reference value associated to the reward video



+ (kaskbluai_PlayerType) getPlayerType

Gets the type of the player to know if he is in the BLU cohort
Returns the type of the player (BLU, REF or PENDING)

typedef NS_ENUM(NSInteger, kaskbluai_PlayerType)
{
    kaskbluai_PlayerType_PENDING = 0,  //the SDK has not finished initializing yet
    kaskbluai_PlayerType_REF = 1, //the player is not in the BLU cohort
    kaskbluai_PlayerType_BLU = 2 //the player is in the BLU cohort

};
public static void initWithKey (Activity activity, String apiKey, boolean isNewPlayer, askbluai_PlayerTypeChoice pTChoice, askbluai_Mode mode)

Initializes askblu.ai with an API Key and a player status.

Parameters:
activity - the android activity
apiKey - The askblu.ai API key of the game
isNewPlayer - Must be false if the player already played the game before askblu.ai integration, true otherwise
pTChoice - to set the player type automatically or manually
mode - the chosen operating mode for the SDK

public final class askbluai_PublicSettings
{
    public static enum askbluai_Mode {

        RELEASE(0), //enable the askblu.ai SDK
        DEBUG(1); //enable the SDK in Debug Mode
    }

    public static enum askbluai_PlayerTypeChoice {

        AUTO(0), //the player type is chosen by askblu.ai
        REF(1),  //the player won't be in the BLU cohort
        BLU(2); //the player will be in the BLU cohort
    }
}

Warning: askblu.ai will not be active in the SDK Debug Mode and will only work in the SDK Release Mode. The mode must always be set to RELEASE before submitting an application




public static void resume (Activity activity)

Tells askblu.ai the application has entered foreground

Parameters:
activity - the android activity



public static void suspend (Activity activity)

Tells askblu.ai the application has entered background

Parameters:
activity - the android activity



public static void stageStarted (Activity activity, string stageTag, float handicap)

Tells askblu.ai the player has started a stage

Parameters:
activity - the android activity
stageTag - the current stage's unique identifier
handicap - if the player starts the stage with a handicap, float from 0 (no handicap) to 1 (maximum handicap)


public static void saveMeUsed (Activity activity)

Tells askblu.ai the player should have failed the stage but used a way to continue playing it

Parameters:
activity - the android activity



public static void stageEnded (Activity activity, askbluai_Result result, askbluai_How how, float helped)

Tells askblu.ai information about how the player ended the stage

Parameters:
activity - the android activity
result - the player result when the stage ended
how - how the player ended the stage, easily, normally or with difficulty
helped -  how the player was helped to finish the stage, from 0 (no helped) to 1 (guaranteed win for the player)

public final class askbluai_PublicSettings
{
    public static enum askbluai_Result {

        FAIL(0),
        SUCCEED(1),
        GIVEUP(2),
        DRAW(3);
    }

    public static enum askbluai_How {

        NORMAL(0),
        CLOSE(1),
        LARGE(2);
    }
}



public static void stageResumed (Activity activity, string stageTag, float stageProgress)

Tells askblu.ai the player has resumed a stage in another session

Parameters:
activity - the android activity
stageTag - the current stage's unique identifier
stageProgress - value between 0 and 1 corresponding to the player's progression in the stage



public static void stageSuspended(Activity activity)

Tells askblu.ai the user has suspended a stage (that he can resume later)


public static void purchaseConfirmed(Activity activity, askbluai_PublicSettings.askbluai_MAWhy why, float coef)

Tells askblu.ai the player has made a purchase

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the purchase

public final class askbluai_PublicSettings
{
    public static enum askbluai_MAWhy {

      PROGRESS(0), //when the purchase helps the player to progress
      VIRTUAL_CURRENCY(1),   //when the player purchases virtual currency
      NO_ADS(2),   //when the purchase enables to remove ads
      SAVE_ME(3),   //when the purchase enables the player to continue playing instead of losing
      OTHER(4);   //if none of the other choices match
    }
}



public static void rewardVideoWatched(Activity activity, askbluai_PublicSettings.askbluai_MAWhy why, float coef)    

Parameters:
why - the impact of the purchase in the game
coef - the reference value associated to the reward video



public static void interstitialAdDisplayed(Activity activity, askbluai_PublicSettings.askbluai_Placement placement, float coef)

Parameters:
placement - the placement where the interstitial is displayed
coef - the reference value associated to the interstitial ad

public final class askbluai_PublicSettings
{
    public static enum askbluai_MAWhy {

      STARTUP(0),
      HOME_IN(1),
      HOME_OUT(2),
      STAGE_IN(3),
      STAGE_OUT(4),
      MENU_IN(5),
      MENU_OUT(6),
      STORE_IN(7),
      STORE_OUT(8),
      ACHIEVEMENT_IN(9),
      ACHIEVEMENT_OUT(10),
      SETTINGS_IN(11),
      SETTINGS_OUT(12),
      IN_GAME(13),
      PAUSE(14),
      OTHER(15);
    }
}



public static void interstitialAdTouched(Activity activity, askbluai_PublicSettings.askbluai_Placement placement)

Parameters:
placement - the placement where the interstitial is displayed



public static void askBLUDiff (Activity activity, string stageTag)

Asks askblu.ai which difficulty should be used for a defined stage

Parameters:
activity - the android activity
stageTag - the unique identifier of the chosen stage



public static bool hasDiffAnswer (Activity activity)

Checks if the SDK has received the response from askblu.ai

Parameters:
activity - the android activity
Returns true if the answer has been received, false otherwise



public static askbluai_Diff getBLUDiff (Activity activity)

Gets the askblu.ai response

Parameters:
activity - the android activity
Returns the difficulty that needs to be set for the stage

public final class askbluai_PublicSettings
{
    public static enum askbluai_Diff {

        DEFAULT(0),
        EASIER(1),
        HARDER(2),
        REF(3);
    }
}



public static void askBLUAd(Activity activity, askbluai_PublicSettings.askbluai_Placement placement)

Asks askblu.ai if an interstitial advert should be displayed

Parameters:
placement - the placement where the interstitial will be displayed



public static boolean hasAdAnswer(Activity activity)

Checks if the askblu.ai response of the askBLUAd request has been retrieved from the server to the SDK
Returns true if the answer has been received, false otherwise



public static boolean getBLUAd(Activity activity, boolean defaultAnswer, float coef)

Gets the askblu.ai response of the askBLUAd request
Returns the advised difficulty returned by askblu.ai, true if an advert should be displayed, false otherwise

Parameters:
defaultAnswer - the answer returned if the server response has not been received
coef - the reference value associated to the reward video



public static askbluai_PublicSettings.askbluai_PlayerType getPlayerType(Activity activity)

Gets the type of the player to know if he is in the BLU cohort
Returns the type of the player (BLU, REF or PENDING)

public final class askbluai_PublicSettings
{
    public static enum askbluai_Diff {

        PENDING(0),   //the SDK has not finished initializing
        REF(1), //the player is not in the BLU cohort
        BLU(2); //the player is in the BLU cohort
    }
}