Skip to content
Andrew edited this page May 8, 2019 · 21 revisions

Allow2Unity

Here you will find Getting Started Guides, API Documentation and Samples.

Why?

Simple, you already try to get more users, so why not increase the pool? Provide Parental Freedom™ and see even more parents happy to buy your games. Better still, get more parents recommending your game to even more parents.

Essentially, if you don't choose to add Allow2, then you are happy with less users and lower sales.

Oh, and it's completely free.

Quick Start and Example

Allow2 has designed to remove all the complexity to allow you to focus on making a great game.

This section provides the basic steps to integrate and leverage the Allow2 Parental Freedom™ SDK for Unity.

Step 1: Initialise the Library

Before using any functions, set the device token (create one with (your free Allow2 Developer Account)[https://developer.allow2.com]). You should do this early in the program lifecycle, probably in your base setup or root view initialisation code.

    // change this to your specific device token from your Allow2 developer account.
    Allow2.DeviceToken = "B0hNax6VCFi9vphu"; 

Step 2:

Somewhere in settings, provide the option to "Pair" the device/game with Allow2. This can only be done once, and can only be released by the parent account once paired. The pairing details are persisted in the player prefs, but there is a check that will lock up the game if a child tries to clear the player prefs, until the parent releases the device/app and re-pairs it.

You can easily check if paired with Allow2:

if (Allow2.IsPaired) { ... }

If not paired, then you can provide an interface to allow pairing. The simplest way to let users pair Allow2 is to provide a username(email) and a password field and have a "Pair" button.

On clicking the "Pair" button:

  1. Disable the pairing button and show an indeterminate progress indicator.
  2. Call the "Pair" method on the Allow2 Library (and supply a callback for completion notification).
    Allow2.Pair(
            this,                                          // Allow2 needs a MonoBehaviour
            "user supplied allow2 account email address",  // the user account
            "user supplied password",                      // their password
            "Name of your App or Game",                    // the name you want to appear in their Allow2 account
            delegate (string err, Allow2CheckResult result)
            {
                remove_spinner();                          // stop the activity indicator
                if (err != null) {
                    // something went wrong, the pairing did not work for the reason in the string.
                    show_error_to_user(err);
                    reenable_pair_button();
                    clear_password_field_and_set_focus();  // essentially up to you what makes sense for your app
                    return;
                }
            });

Step 3:

Clone this wiki locally