Ironsource ads for cordova based development
npm install cordova-plugin-ironsource-ads
--------
- State of Development
- Install
- Usage
- Official IronSource Documentation
--------
``bash`
cordova plugin add cordova-plugin-ironsource-ads
--------
- Initialization
- Validate Integration
- Set Dynamic User ID
- Rewarded Videos
- Has Rewarded Video
- Show Rewarded Video
- Rewarded Video Events
- Interstitials
- Has Interstitial
- Load Interstitial
- Show Interstitial
- Interstitial Events
- Offerwalls
- Has Offerwall
- Show Offerwall
- Offerwall Events
All methods support optional onSuccess and onFailure parameters
javascript
IronSourceAds.init({
appKey: appKey
});
`$3
Once you have finished your integration, call the following function and confirm that everything in your integration is marked as VERIFIED:`javascript
IronSourceAds.validateIntegration();
`
Check xcode / android studio debugger for validation output

*
$3
> The Dynamic UserID is a parameter that can be changed throughout the session and will be received in the server-to-server ad > rewarded callbacks. This parameter helps verify AdRewarded transactions and must be set before calling ShowRV.
`javascript
IronSourceAds.setDynamicUserId({userId:'example'});
`
*
$3
#### Has Rewarded Video
`javascript
IronSourceAds.hasRewardedVideo({
onSuccess: function (available) { }
});
`#### Show Rewarded Video
`javascript
IronSourceAds.showRewardedVideo();
`#### Rewarded Video Events
Rewarded Video Availabilty Changed
`javascript
window.addEventListener("rewardedVideoAvailabilityChanged", function(event){ var available = event.available;
});
`
Rewarded Video Rewarded
`javascript
window.addEventListener("rewardedVideoRewardReceived", function(event){ var placement = event.placement;
var placementName = placement.placementName;
var rewardAmount = placement.rewardAmount;
var rewardName = placement.rewardName;
});
`
Rewarded Video Started
`javascript
window.addEventListener("rewardedVideoStarted", function(){});
`
Rewarded Video Ended
`javascript
window.addEventListener("rewardedVideoEnded", function(){});
`
Rewarded Video Opened
`javascript
window.addEventListener("rewardedVideoOpened", function(){});
`
Rewarded Video Closed
`javascript
window.addEventListener("rewardedVideoClosed", function(){});
`
Rewarded Video Failed
`javascript
window.addEventListener("rewardedVideoFailed", function(){});
`
*
$3
#### Has Interstitial
`javascript
IronSourceAds.hasInterstitial({
onSuccess: function (available) { }
});
`
#### Load Interstitial
_Must be called before showInterstitial
`javascript
IronSourceAds.loadInterstitial();
`
*
#### Show Interstitial
`javascript
IronSourceAds.showInterstitial();
`
*
#### Interstitial EventsInterstitial Loaded
`javascript
window.addEventListener("interstitialLoaded", function(){});
`
Interstitial Shown
`javascript
window.addEventListener("interstitialShown", function(){});
`
Interstitial Show Failed
`javascript
window.addEventListener("interstitialShowFailed", function(){});
`
Interstitial Clicked
`javascript
window.addEventListener("interstitialClicked", function(){});
`
Interstitial Closed
`javascript
window.addEventListener("interstitialClosed", function(){});
`
Interstitial Will Open
`javascript
window.addEventListener("interstitialClosed", function(){});
`
Interstitial Failed To Load
`javascript
window.addEventListener("interstitialFailedToLoad", function(){});
`
*$3
#### Has Offerwall
`javascript
IronSourceAds.hasOfferwall({
onSuccess: function (available) { }
});
`#### Show Offerwall
`javascript
IronSourceAds.showOfferwall();
`#### Offerwall Events
Offerwall Availability Changed
`javascript
window.addEventListener("offerwallAvailabilityChanged", function(event){
var available = event.available;
});
`Offerwall Shown
`javascript
window.addEventListener("offerwallShown", function(){});
`
Offerwall Credit Recieved
`javascript
window.addEventListener("offerwallCreditReceived", function(event){
var credits = event.credits; // The number of credits the user has earned since //the last (void)didReceiveOfferwallCredits:
var totalCredits = event.totalCredits; //The total number of credits ever earned by the user
});
`
Offerwall Credit Failed
`javascript
window.addEventListener("offerwallCreditFailed", function(){});
`
Offerwall Closed
`javascript
window.addEventListener("offerwallClosed", function(){});
`
Offerwall Show Failed
`javascript
window.addEventListener("offerwallShowFailed", function(){});
``