Initialize

Initialization method:

val config = InitConfig(
    accountId = "<<accountId provided by Arcplay>>",
    userId = "<<userId of your app's user>>"
)

Arcplay.init(this, config, object : ArcplayInitListener {
    override fun onSuccess() {
        Log.i("Arcplay", "Init success!")
    }
    override fun onFailure(error: ErrorData) {
        Log.e("Arcplay", "Init failed : ${error.code} - ${error.message}")
    }
})

The callback from Arcplay.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 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

context

Activity

Yes

Activity context

gdprFlag

Boolean

No

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

ccpaFlag

Boolean

No

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

coppaFlag

Boolean

No

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

googleFamilyProgramFlag

Boolean

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 Arcplay.init then update the InitConfig and again do Arcplay.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. onFailure(error: ErrorData) 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 Arcplay.init

400

Init Succeeded, Launch Failed!

Arcplay.init was successful but Arcplay.launch has failed

Last updated