PinsightMedia.init()

Type function
Library PinsightMedia.*
Return value [TYPE][api.type.TYPE]
Revision 2014.2478
Keywords
Sample code
See also

Overview

Initializes the Pinsight Media + library. Need to do only once. 

Syntax

PinsightMedia.init(ProductName,Version,listener)
ProductName (required)

TYPE. Use the app name provided to you from PinsightMedia.

Version (required)

Table. The version number of your application[Android Only].

listener (Optional)

TYPE. Function name you want responses from the ad library to be returned.It will be called for every new ad that is requested according to the interval.

Examples

local function listener( event )
    -- Indicates the adType. "Banner" For banner ad, "Interstitial" For Interstitial Ad
    -- "Square" For Square Ad [Suqare Ad is available in IOS only]
    print(event.adType)

    --[[ Indicates wheather ad is loaded or failed to load or clicked.
    For Android Possible return value are following:
    "Requested" - when banner ad or Interstitial is requested
    "Received" - when banner ad or Interstitial is received
    "GetAdFailed" - when request for the banner ad or Interstitial fails
    "Clicked" - when banner ad or Interstitial is clicked
    "Closed" - when banner ad or Interstitial is closed
    "Displayed" - when banner ad or Interstitial is displayed

    For IOS Possible return value are following:
    For Interstitial Ad only
    "GetAdFailed" - when Interstitial Ad is failed to load
    "GetAdSucceeded" - when Interstitial Ad is succeessfully loaded
    "Activated" -  when Interstitial is activated
    "AdDidExpand" -  when Interstitial Ad will expand on screen
    "AdDidCollapse" - when Interstitial  Ad is collapse
    "Clicked" - when ad is clicked
    "Closed" - when Interstitial is closed

    For Banner Ad and Square Ad only
    "GetAdFailed" - when Ad is failed to load
    "GetAdSucceeded" - when Ad is succeessfully loaded
    "fullScreenWebViewActivated" - When clicked on ad and full screen view apears
    "fullScreenWebViewClosed" - when full screen view is closed
    "adDidCollapse" -  when Ad is collapse
    "adDidExpand" -   when Ad is expand on screen
    "adClicked" - when Ad is clicked
    ]]--
    print(event.adStatus)
end

PinsightMedia.init( "adlibdemo","2.1.2",listener )