Skip to content
This repository was archived by the owner on Jun 23, 2024. It is now read-only.

notmedia/cordova-plugin-chartboost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-chartboost

Chartboost ads for Apache Cordova

WARNING: This plugin available only for iOS.

Install plugin

$ cordova plugin add cordova-plugin-chartboost

Methods

Chartboost.startWithAppId(appID, appSignature)

Initial method wich connect to Chartboost.
(string) appID - the appID of your app in Tapjoy Dashboard.
(string) appSignature - the appKey of your app in Tapjoy Dashboard.

Chartboost.setCustomId(customID)

Set a custom identifier to send in the POST body for all Chartboost API server requests.
(string) customID

Chartboost.downloadRewardedVideo()

Downloads rewarded video.

Chartboost.showRewardedVideo()

Show rewarded video, when success event was emitted.

Events

document.addEventListener('didCacheRewardedVideo', (data) => {  
  console.log('Chartboost: cached rewarded video.');
});
document.addEventListener('didFailToLoadRewardedVideo', (data) => {
 console.log('Chartboost: failed to load rewarded video.');
});
document.addEventListener('didCompleteRewardedVideo', (error) => {
  console.log('Chartboost: complete rewarded video.');
});

Example

let appID = 'MyAppID';
let appSignature = "MyAppSignature";

Chartboost.startWithAppId(appID, appSignature);
Chartboost.downloadRewardedVideo();

document.addEventListener('didCacheRewardedVideo', (data) => {  
  Chartboost.showRewardedVideo();
});

document.addEventListener('didFailToLoadRewardedVideo', (data) => {
 console.log('Chartboost: failed to load rewarded video.');
});

document.addEventListener('didCompleteRewardedVideo', (error) => {
  console.log('Chartboost: complete rewarded video.');
});

paypal

About

Chartboost ads for Apache Cordova

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors