Git Product home page Git Product logo

cordova-plugin-ironsource-ads's Introduction

IronSource Ads Cordova Plugin


Table of Contents

State of Development


Install

cordova plugin add cordova-plugin-ironsource-ads

Usage

All methods support optional onSuccess and onFailure parameters

Initialization

IronSourceAds.init({
    appKey: appKey
});

Validate Integration

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


Set Dynamic User ID

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'});

Rewarded Videos

Has Rewarded Video

IronSourceAds.hasRewardedVideo({
    onSuccess: function (available) {

    }
});

Show Rewarded Video

IronSourceAds.showRewardedVideo();

Rewarded Video Events

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(){

});

Interstitial

Has Interstitial

IronSourceAds.hasInterstitial({
    onSuccess: function (available) {

    }
});

Load Interstitial

_Must be called before showInterstitial

IronSourceAds.loadInterstitial();

Show Interstitial

IronSourceAds.showInterstitial();

Interstitial Events

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(){

});

Offerwalls

Has Offerwall

IronSourceAds.hasOfferwall({
    onSuccess: function (available) {

    }
});

Show Offerwall

IronSourceAds.showOfferwall();

Offerwall Events

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(){

});

Adding Additional SDKS

By default, this plugin does not contain other ad providers sdks

Android

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

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>

cordova-plugin-ironsource-ads's People

Contributors

charlesbodman avatar dexus avatar fabiowidmer avatar saqsun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-plugin-ironsource-ads's Issues

Duplicate android.permission.WRITE_EXTERNAL_STORAGE

I have installed Cordova 8.1.2 ([email protected]), Android 8.0.0 and gradle 5.3.1 and the build fails with the following error:

/home/development/cordova/appname/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/development/cordova/appname/platforms/android/app/src/main/AndroidManifest.xml:49:5-108 Error:
Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:49:5-108 duplicated with element declared at AndroidManifest.xml:48:5-81
/home/development/cordova/appname/platforms/android/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting

FAILURE: Build failed with an exception.

AndroidManifest.xml contains the following permissions:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:maxSdkVersion="18" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

The first permission was added by another plugin, cordova-plugin-file, the second permission was added by cordova-plugin-ironsource-ads.
Commenting out the any permisions in the plugin.xml (in the plugin folder) and removing it from AndroidManifest.xml solves the issue, but I hope it can be avoided in the following versions.

By the way, when do you think it is going to be ready the banner?

Ionic Demo !!

Any Example code for Ionic , I have successfully initialized ironsource but ads won't shown and events listening either not responding.

iOS Install Issue

Hi Charles,

similar to this issue #13

i see an error when trying to install the plugin for ios:

Installing "cordova-plugin-ironsource-ads" for ios
Failed to install 'cordova-plugin-ironsource-ads': Error: pod: Command failed with exit code 1
    at ChildProcess.whenDone (/path/to/project/platforms/ios/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)
(node:38516) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: pod: Command failed with exit code 1
(node:38516) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Ionic:
   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.3.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.3.8
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.5.1

Cordova:
   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 15 other plugins)

System:
   ios-deploy : 1.9.2
   NodeJS     : v8.9.1 (/usr/local/bin/node)
   npm        : 5.5.1
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

Thanks a lot for your work and your help!

iOS - Missing system frameworks (MobileCoreServices, CoreGraphics, UIKit)

Hello,

i'm trying to add AdColony, UnityAds, Vungle and Chartboost as additional networks.
Unity works fine. The others don't.

validateIntegration logs this:

--------------- AdColony --------------
Adapter VERIFIED
SDK - version 3.3.7.0 - VERIFIED
Missing system framework: MobileCoreServices, please be sure to add it to your project.
Frameworks - *** MISSING ***
Adapter Version 4.1.5 - VERIFIED
--------------- UnityAds --------------
Adapter VERIFIED
SDK - version 3.0.0 - VERIFIED
Frameworks - VERIFIED
Adapter Version 4.1.2 - VERIFIED
--------------- Vungle --------------
Adapter VERIFIED
SDK - version 6.3.2 - VERIFIED
Missing system framework: CoreGraphics, please be sure to add it to your project.
Frameworks - *** MISSING ***
Adapter Version 4.1.6 - VERIFIED
--------------- Chartboost --------------
Adapter VERIFIED
SDK - version 7.3.0 - VERIFIED
Missing system framework: CoreGraphics, please be sure to add it to your project.
Missing system framework: UIKit, please be sure to add it to your project.
Frameworks - *** MISSING ***
Adapter Version 4.1.6 - VERIFIED

Any idea what goes wrong?

Banner IONIC Cordova >= 7.0.1

Hi,

i have update my project with ultimate version code.
The banner not work; in the previuosu versione yes.
I receive a success callback and the banner not open.

I call the function in this mode:

IronSourceAds.loadBanner();
      IronSourceAds.showBanner({
        size: "standard", // Optional ("standard","large","rectangle","tablet")
        position: "bottom", //Optional ("top", "bottom", "center"),
        onSuccess: (success) => {
       console.log(success)
        }, // Optional
        onFailure: (error) => { console.log(error)} // Optional
      });

Can you help me?

Error while launching cordova build

Hi Charles,

I got the following output after launching cordova build with the plugin:

cordova_build

Here are my env info:

info

It looks to be a version compaibility issue, do you have an idea of what I should change ?

Thanks,

Error cordova build

Hello,
while launching cordova i get this error

`3 actionable tasks: 2 executed, 1 up-to-date
FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all files for configuration ':debugCompileClasspath'.

Could not find com.ironsource.sdk:mediationsdk:6.7.12.0.
Searched in the following locations:
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/google/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
file:/C:/Users/HDSKTPL-PC/AppData/Local/Android/Sdk/extras/android/m2repository/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
https://jcenter.bintray.com/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
https://jcenter.bintray.com/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
https://maven.google.com/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
https://maven.google.com/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
https://adcolony.bintray.com/AdColony/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
https://adcolony.bintray.com/AdColony/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar
https://dl.bintray.com/ironsource-mobile/android-sdk/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.pom
https://dl.bintray.com/ironsource-mobile/android-sdk/com/ironsource/sdk/mediationsdk/6.7.12.0/mediationsdk-6.7.12.0.jar`
Any help please ?

App crashes on enabling mediation

Hi,

I am using cordova-plugin-ironsource-ads for showing ironsource ads. App runs perfectly fine when i run ironsource ads but when i enable any other mediation network app crashes.

On debugging i found two issue.

  1. The mediation network i have integrated are showing "not verified" on running IronSourceAds.validateIntegration();
  2. Error "No adapters ready to show"

Can somebody help me point out what i am doing wrong.
Screenshot (30)

Adapters out of reach - Interstitial not working anymore

Hello guys,
since 18 April, 2018 my iOS app has no more interstitial impressions (on ironsource it is 0). I am using mediation where Unity, Admob und Ironsource are integrated. I did not update the app since then, so from one day to another it is not working anymore.

I take a look at Xcode, debug my app and the problem is "Adapters out of reach". Then I updated the SDK from Ironsource, but still "Adapters out of reach". Is it a problem with this Cordova Plugin which should be updated or has Ironsource Mediation a problem? This only occurs on iOS! I contacted Ironsource, but as I know their support, it will need days until they answer.

PS: Rewarded Videos is still working, only interstital is not working

Error integrating the plugin

Hello i'm integrating this plugin and all worked well. I was able to show test offerwall, make callback to reward user etc.

But suddenly, i can't show any ad or offerwall, i've this kind of error "loadUrl(javascript:cordova.fireWindowEvent('onOfferwallShowFailed', {"errorCode":508,"errorMessage":"Offerwall - showOfferwall can't be called before the Offerwall ad unit initialization completed successfully"});)".
It's happened with no logic because I have not changed anything in my application.

Can you help me ?
thanks

Class EBanner deprecata

Hi there is an error compile.
The import class "import com.ironsource.mediationsdk.EBannerSize;" not work. Probably is deprecated.
I think the new class is "import com.ironsource.mediationsdk.ISBannerSize;"
Could you correct it?

Thank you so much for the good work

interstitialFailedToLoad triggered each time in live mode

I managed to work with you plugin to show ads in test mode however in live mode I always get interstitialFailedToLoad error. Is there something I'm doing wrong?

Here is what I do:

                IronSourceAds.init({
                    appKey: "xxx"
                });

                    window.addEventListener("interstitialLoaded", function () {
                        IronSourceAds.showInterstitial();
                    });
                    window.addEventListener("interstitialFailedToLoad", function (e) {
                        console.warn('unable to load interstitial', e) // this gets always triggered!
                        innerCallback();
                    });
                    IronSourceAds.loadInterstitial();
                    window.addEventListener("interstitialShown", innerCallback);
                    window.addEventListener("interstitialShowFailed", innerCallback);

iOs 14

Any update please with this plugin, ads stops working with iOs14

RequestAnimationFrame performance drops after opening offerwall or rewarded video

In my phaser2ce game... on android

RequestAnimationFrame performance drops after opening offerwall or rewarded video.

Seems the browser is throttling when it is blurred by the native stuff. Like on desktop when you switch tabs.

Tacky workaround right now is location.reload when offerwall closed etc (which restores framerate)

Not sure what to do about this. Seems to only noticably affect canvas rendering rather than webgl.

Any ideas??

Help wanted

Hey everyone! I haven't had time to work on this plugin as of late.

I've moved to a different company that doesn't use cordova and don't have the time to keep this updated.

Any pull requests / help is much needed / wanted as you can tell by the issues / lack of updates.

IOS Install issue

Hi, I am trying to install the plugin for ios project but this error appear:

Failed to install 'cordova-plugin-ironsource-ads': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/Users/gamezoka/Desktop/cordova/farkleking/platforms/ios/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)

Did I miss something, I installed ironsourceSDK, please guide me, thank you very much!

showOfferwall displays a white screen

This issue follows the discussion started here.

As this might be linked to my implementation or ironsource configuration, I've tried with this plugin and it works correctly except the offerwall does not reopen once closed.

Here is the code:

function displayOfferWall(){
                if (window.IronSourceAds) {
                    window.IronSourceAds.setDynamicUserId({
                        userId: vm.currentUser.id
                    });
                    window.IronSourceAds.showOfferwall();
                }
        }

and my info :

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.