Initialize

Before launching ArcPlay, have your app initialize the ArcPlay SDK by calling ArcplayPlugin.Init(). This needs to be done only once, ideally at app launch.

Initialization method: Here's an example of how to call ArcplayPlugin.Init() within the Start() method of a script attached to a GameObject:

...
using Arcplay;
...

public class ArcplayScript : MonoBehaviour
{
    public void Start()
    {
        InitConfig config = new InitConfig(
            accountId: "<<accountId provided by Arcplay>>",
            userId: "<<userId of your app's user>>"
        );
        
        ArcplayPlugin.Init(config, new ArcplayInitListener(
                onSuccess: () =>
                {
                    Debug.Log("Success");
                },
                onFailure: (int code, string message) =>
                {
                    Debug.LogError($"Error {code}: {message}");
                }
            )
        );
    }
}

The callback from ArcplayPlugin.Init() can be used to check the accessibility of the ArcPlay.ai experience and accordingly enable or disable the entry point nudge.

  1. onSuccess() - Enable the ArcPlay.ai nudge

  2. onFailure() - Disable the ArcPlay.ai nudge

Below mentioned are the definitions of InitConfig constructor parameters:

Parameter name
Data type
Mandatory
Description

accountId

string

Yes

A unique identifier for your publisher account shared by ArcPlay.ai team at the time of onboarding NOTE: ArcPlay.ai customer success team will provide each publisher with distinct accountId for facilitating the development and production use cases.

userId

string

Yes

The unique identifier of users inside your application's environment.

clientId

string

No

The unique identifier for app instances. This is used when users is not logged in your app. NOTE: If you set clientId in the InitConfig then userId is NOT mandatory

gdprFlag

bool

No

true for users from EU which have exercised Data Subject Rights under GDPR. Else false.

ccpaFlag

bool

No

true for users from USA which have exercised Data Subject Rights under CCPA. Else false.

coppaFlag

bool

No

true for users from USA which are under the age of 16 years. Else false.

googleFamilyProgramFlag

bool

No

true for users which have opted-in for the Google Family Program. Else false.

NOTE:

  1. If any of the InitConfig parameters changes after the user has ArcplayPlugin.Init then update the InitConfig and again do ArcplayPlugin.Init

  2. The set userId, will be used to award virtual currency (reward) to the user. If set incorrectly, the users will not be rewarded.

  3. The userId and clientId can be up to 190 characters long.

  4. For data security and GDPR compliance purposes, userId should not include any recognizable or identifiable information, such as a username, real name, or email address.

  5. For security and fraud detection purposes, the userId should be constant for the user's lifetime.

  6. The Error callback can be because of the following cases:

Error code
Message
Description

300

Disabled by ArcPlay.ai team

App has been blocked. Please reach out to Arcplay.ai Customer Success team for assistance

301

Blocked User

Particular user has been blocked for fraudulent activities

302

Age restricted

A non-adult user has been blocked

303

EU restricted

A user from EU has been blocked as he has exercised Data Subject Rights under GDPR

304

Ads SDK not initialized

Ads mediation sdk instance was not found (eg: AdMob, Ironsource etc)

305

Servers unreachable

ArcPlay.ai servers are not accessible. The team is notified of the issue and working on fixing it

306

Incorrect Inputs

accountId or userId provided is null

307

Failed to process

Internal error. The team is notified of the issue and working on fixing it

308

Duplicate Request

InitConfig called before getting callback from ArcplayPlugin.Init

400

Init Succeeded, Launch Failed!

ArcplayPlugin.Init was successful but ArcplayPlugin.Launch has failed

Last updated