PlayHaven is a native extension to use PlayHaven services. PlayHaven is a mobile game LTV-maximization platform to help with the business of games. It target to acquire, retain, re-engage, and monetize players with the help of a marketing platform. Once integrated the service can be used to analyze in-game promotions and monetization in real-time through PlayHaven’s web-based dashboard.

PlayHaven services are able to add the placements, widgets, rewards, content, and Virtual Goods Promotion items that a developer wants to use. It’s possible to take note of the tokens, keys,and placement tags of an app.

Sample

if(PlayHaven.isSupported()) {
    PlayHaven.create("your_token","your_secret","your_gcm_project_number");
} else {
    trace("extension works on iOS And Android only.");
}

PlayHaven.create("your_ios_token","your_ios_secret","your gcm project number", "your_android_token","your_android_secret");
PlayHaven.playhaven.reportGameOpen();
PlayHaven.playhaven.preloadContentRequest("your_placement_id");

// set up event listeners for content overlays
PlayHaven.playhaven.addEventListener(PlayHavenEvent.CONTENT_OVERLAY_DISMISSED,onContentDismissed);
PlayHaven.playhaven.addEventListener(PlayHavenEvent.CONTENT_OVERLAY_DISPLAYED,onContentDisplayed);
PlayHaven.playhaven.addEventListener(PlayHavenEvent.CONTENT_OVERLAY_FAILED,onContentFailed);

// start the content request
PlayHaven.playhaven.sendContentRequest("more_games");

function onContentDisplayed(e:PlayhavenEvent):void {
    // an overlay is showing - pause for now...
    pauseGame();
    stopSounds();
}

funnction onContentDismissed(e:PlayHavenEvent):void {
    // overlay is closed - resume the game
    resumeGame();
    resumeSounds();

    // the event's contentDismissalReason property holds a value
    // from the ContentDismissalReason constants class- indicating
    // the reason the view was dismissed:
    switch(e.contentDismissalReason) {
        case ContentDismissalReason:USER_CONTENT_TRIGGERED: trace("the user or content unit closed the window."); break;
        case ContentDismissalReason:USER_BUTTON_CLOSED: trace("the close button was pushed."); break;
        case ContentDismissalReason.APP_BACKGROUNDED: trace("the app was sent to the background."); break;
        case ContentDismissalReason:NO_CONTENT_AVAILABLE: trace("no content was found for the placement."); break;
    }
}
Air Native Extension, Android, iOS. URL.