🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@ironsource-plus/cordova-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ironsource-plus/cordova-plugin

Support for ironSource ads in Cordova and Phonegap apps

latest
Source
npmnpm
Version
1.3.4
Version published
Maintainers
1
Created
Source

IronSource Ads Cordova Plugin

Add support for IronSource Ads to your Cordova and Phonegap based mobile apps.

History

This is a fork of cordova-plugin-ironSource. It aims to be kept up to date as well as enable ad mediation. It is planned to be a drop-in replacement and will retain the same api of that plugin.

Currently supports ironSource 8.3.0 (for both iOS and Android)

How do I install it?

Install using cordova:

cordova plugin add @ironsource-plus/cordova-plugin

How do I use it?

First, you'll need to construct a new instance of the plugin using new IronSourceAds.

The constructor can take 2-4 arguments. The first one is your AppKey from IronSource. The second is a user Identifier. This can be anything and is described in the IronSource docs.

The last two are optional. A callback to be ran after the plugin is initialized and true/false to enable the test suite (default false);

document.addEventListener('deviceready', function() {

	var isAds = new IronSourceAds("app_key", "some_unique_userid", function(){console.log('Init has finished');}, false);

	// show a rewarded ad
	isAds.showRewardedAd();

	// show a rewarded ad for placement RightHere
	isAds.showRewardedAd("RightHere");

    // show an interstitial
    isAds.showInterstitial();

    // launch in Android Studio/Xcode mediation integration verification
    isAds.validateIntegration();

    // Check is a rewarded video is available to show
    isAds.isRewardedVideoAvailable(function () {
    	alert('Yes');
	}, function () {
		alert('No');
	});

	// Check is an interstitial is available to show
    isAds.isInterstitialAdAvailable(function () {
    	alert('Yes');
	}, function () {
		alert('No');
	});

	// reward your users
	window.addEventListener("onRewardedVideoAdClosed", function(e) {

		var placement = e.placement;
		console.log(placement.placementName);
		console.log(placement.rewardName);
		console.log(placement.rewardAmount);
	}, false);

}, false);

Can I just see a working example?

Yep. Check out the demo project. It runs on both Android and iOS.

What events are supported?

Interstitial

  • onInterstitialAdClicked
  • onInterstitialAdClosed
  • onInterstitialAdLoadFailed
  • onInterstitialAdOpened
  • onInterstitialAdReady
  • onInterstitialAdShowFailed
  • onInterstitialAdShowSucceeded

Rewarded Video

  • onRewardedVideoAdClosed
  • onRewardedVideoAdOpened
  • onRewardedVideoAdRewarded
  • onRewardedVideoAdShowFailed
  • onRewardedVideoAvailabilityChanged
  • onRewardedVideoAdClicked

Keywords

ecosystem:cordova

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts