trialPay.init()

Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, TrialPay, init
See also trialPay.show()
trialPay.*

Overview

trialPay.init() initializes the TrialPay plugin.

Once initialized, you can show an ad using trialPay.show().

Syntax

trialPay.init( adListener, params )
adListener (required)

Listener. Listener function that will receive adsRequest events.

params (required)

Table. Table containing TrialPay initialization values — see the next section for details.

Parameter Reference

The params table includes parameters for TrialPay initialization.

appKey (required)

String. Your TrialPay app key, obtained from the TrialPay dashboard.

sid (required)

String. The ID for the current user of your app. This must be an alphanumeric string that is 2 to 150 characters long and it must not begin with 0.

Example

local trialPay = require( "plugin.trialPay" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.isError )
    end
end

-- Initialize the TrialPay plugin
trialPay.init( adListener, { appKey="YOUR_APP_KEY", sid="user1" } )