cordova plugin add https://github.com/ciaoben/cordova-plugin-ironsource-ads
All methods support optional onSuccess
and onFailure
parameters
IronSourceAds.init({
appKey: appKey,
});
Once you have finished your integration, call the following function and confirm that everything in your integration is marked as VERIFIED:
IronSourceAds.validateIntegration();
Check xcode / android studio debugger for validation output
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.
IronSourceAds.setDynamicUserId({ userId: "example" });
IronSourceAds.hasRewardedVideo({
onSuccess: function (available) {},
});
IronSourceAds.showRewardedVideo();
Rewarded Video Availabilty Changed
window.addEventListener("rewardedVideoAvailabilityChanged", function (event) {
var available = event.available;
});
Rewarded Video Rewarded
window.addEventListener("rewardedVideoRewardReceived", function (event) {
var placement = event.placement;
var placementName = placement.placementName;
var rewardAmount = placement.rewardAmount;
var rewardName = placement.rewardName;
});
Rewarded Video Started
window.addEventListener("rewardedVideoStarted", function () {});
Rewarded Video Ended
window.addEventListener("rewardedVideoEnded", function () {});
Rewarded Video Opened
window.addEventListener("rewardedVideoOpened", function () {});
Rewarded Video Closed
window.addEventListener("rewardedVideoClosed", function () {});
Rewarded Video Failed
window.addEventListener("rewardedVideoFailed", function () {});
IronSourceAds.hasInterstitial({
onSuccess: function (available) {},
});
_Must be called before showInterstitial
IronSourceAds.loadInterstitial();
IronSourceAds.showInterstitial();
Interstitial Loaded
window.addEventListener("interstitialLoaded", function () {});
Interstitial Shown
window.addEventListener("interstitialShown", function () {});
Interstitial Show Failed
window.addEventListener("interstitialShowFailed", function () {});
Interstitial Clicked
window.addEventListener("interstitialClicked", function () {});
Interstitial Closed
window.addEventListener("interstitialClosed", function () {});
Interstitial Will Open
window.addEventListener("interstitialClosed", function () {});
Interstitial Failed To Load
window.addEventListener("interstitialFailedToLoad", function () {});
IronSourceAds.hasOfferwall({
onSuccess: function (available) {},
});
IronSourceAds.showOfferwall();
Offerwall Availability Changed
window.addEventListener("offerwallAvailabilityChanged", function (event) {
var available = event.available;
});
Offerwall Shown
window.addEventListener("offerwallShown", function () {});
Offerwall Credit Recieved
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
window.addEventListener("offerwallCreditFailed", function () {});
Offerwall Closed
window.addEventListener("offerwallClosed", function () {});
Offerwall Show Failed
window.addEventListener("offerwallShowFailed", function () {});
By default, this plugin does not contain other ad providers sdks
Follow the integration guides here
Edit src/android/ironsourceads.gradle
from this plugin and add the mediation adapters you need
Example
cdvPluginPostBuildExtras.add({
repositories {
maven {
url "https://dl.bintray.com/ironsource-mobile/android-sdk"
}
}
repositories {
maven {
url "http://dl.bintray.com/ironsource-mobile/android-adapters"
}
}
dependencies {
compile 'com.ironsource.sdk:mediationsdk:6.7.3@jar'
//Example
compile 'com.ironsource.adapters:admobadapter:4.0.3@jar'
compile 'com.ironsource.adapters:facebookadapter:4.0.2@jar'
compile 'com.ironsource.adapters:unityadsadapter:4.0.1@jar'
}
});
IOS requires manual downloading of Adapter & SDK Download Adapters Here and follow the integration guides
_If you have any questions, create an issue, and I'll walk you through it. _
Edit plugin.xml
of this plugin
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="IronSourceAdsPlugin">
<param name="ios-package" value="IronSourceAdsPlugin" />
</feature>
</config-file>
<header-file src="src/ios/IronSourceAdsPlugin.h" />
<source-file src="src/ios/IronSourceAdsPlugin.m" />
<framework src="IronSourceSDK" type="podspec" spec="~> 6.7.3.1" />
<!-- ADD MEDIATION FRAMEWORKS HERE -->
<!-- Example -->
<framework src="IronSourceFacebookAdapter" type="podspec" spec="~> 4.0.2.1" />
<framework src="IronSourceAdMobAdapter" type="podspec" spec="~> 4.0.1.1" />
<framework src="IronSourceUnityAdsAdapter" type="podspec" spec="~> 4.0.1.2" />
<!-- Example -->
<framework src="Foundation.framework" />
<framework src="AVFoundation.framework" />
<framework src="CoreMedia.framework" />
<framework src="CoreVideo.framework" />
<framework src="QuartzCore.framework" />
<framework src="SystemConfiguration.framework" />
<framework src="CoreGraphics.framework" />
<framework src="CFNetwork.framework" />
<framework src="MobileCoreServices.framework" />
<framework src="libz.dylib" />
<framework src="StoreKit.framework" />
<framework src="AdSupport.framework" />
<framework src="CoreLocation.framework" />
<framework src="CoreTelephony.framework" />
<framework src="Security.framework" />
</platform>