Chartboost ads for Apache Cordova
$ cordova plugin add cordova-plugin-chartboost
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.
Set a custom identifier to send in the POST body for all Chartboost API server requests.
(string) customID
Downloads rewarded video.
Show rewarded video, when success event was emitted.
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.');
});
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.');
});