Coder Social home page Coder Social logo

fmbuthia / cordova-plugin-codeplay-facebookads-free Goto Github PK

View Code? Open in Web Editor NEW

This project forked from merbin2012/cordova-plugin-codeplay-facebookads-free

0.0 1.0 0.0 15 KB

Free facebook audience network ads for cordova user. This supports banner ads, Interstitial ads and video ads.

Java 95.19% JavaScript 4.81%

cordova-plugin-codeplay-facebookads-free's Introduction

Code Play facebook audience network free ads

Developed by HTML Code Play and this plugin is used for showing facebook audience network ads.

Git URL

https://github.com/merbin2012/cordova-plugin-codeplay-facebookads-free

Facebook Audience Network SDK version

I will try to keep the latest version, current version is com.facebook.android:audience-network-sdk:5.+

How to Instalation?

Using the Cordova CLI

$ cordova plugin add cordova-plugin-codeplay-facebookads-free

Using the phonegap CLI

$ phonegap local plugin add cordova-plugin-codeplay-facebookads-free

How to Uninstall?

Using the Cordova CLI

$ cordova plugin rm cordova-plugin-codeplay-facebookads-free

Using the phonegap CLI

$ phonegap local plugin rm cordova-plugin-codeplay-facebookads-free

Methods 1

Show Banner Ads

Syntax

cordova.plugins.codeplayfacebookads.showBannerAds(options,success,fail)

Options

var options={
bannerid:"523519301434xxx_xxxxxxxxxxxxxxx"
,isTesting:true|false
}

Example

var options={
bannerid:"523519301434xxx_xxxxxxxxxxxxxxx"
,isTesting:true
};

cordova.plugins.codeplayfacebookads.showBannerAds(options,success,fail);

function success(result)
{
 console.log(result);
}
function fail(result)
{
 console.log(result);
}

Screenshot

Facebook banner ads

Methods 2

Hide Banner Ads

Syntax

cordova.plugins.codeplayfacebookads.hideBannerAds("",success,fail);

function success(result)
{
 console.log(result);
}
function fail(result)
{
 console.log(result);
}

Screenshot

Hide facebook banner ads

Methods 3

Load interstitial ads

Syntax

cordova.plugins.codeplayfacebookads.loadInterstitialAds(options,events,fail);

Options

var options={
interstitialid:"52351930143xxx_xxxxxxxxxxxxxxx"
,isTesting:true|false
}

Example

var options={
interstitialid:"52351930143xxx_xxxxxxxxxxxxxxx"
,isTesting:true
};

cordova.plugins.codeplayfacebookads.loadInterstitialAds(options,events,fail);

function events(event)
{
  if(event === "AdLoaded"){
	 console.log("AdLoaded");
  }
  else if(event === "AdClosed"){
	 console.log("AdClosed");
  }
  else if(event === "AdDisplayed"){
	 console.log("AdDisplayed");
  }
  else if(event === "AdClicked"){
	 console.log("AdClicked");
  }
  else if(event === "AdLogged"){
	 console.log("AdLogged");
  }
}
function fail(result)
{
 console.log(result);
}

Methods 4

Show interstitial ads

Syntax

cordova.plugins.codeplayfacebookads.showInterstitialAds("",success,fail);

Example

cordova.plugins.codeplayfacebookads.showInterstitialAds("",success,fail);

function success(result)
{
 console.log(result);
}
function fail(result)
{
 console.log(result);
}

Screenshot

Facebook Interstitial

Methods 5

Load Video ads

Syntax

cordova.plugins.codeplayfacebookads.loadRewardVideoAd(options,events,fail);

Options

var options={
videoid:"52351930143xxx_xxxxxxxxxxxxxxx"
,isTesting:true|false
}

Example

var options={
videoid:"52351930143xxx_xxxxxxxxxxxxxxx"
,isTesting:true
};

cordova.plugins.codeplayfacebookads.loadRewardVideoAd(options,events,fail);

function events(event)
{
  if(event === "AdLoaded"){
	 console.log("AdLoaded");
  }
  else if(event === "AdClosed"){
	 console.log("AdClosed");
  }
  else if(event === "AdPlaying"){
	 console.log("AdPlaying");
  }
  else if(event === "AdClicked"){
	 console.log("AdClicked");
  }
  else if(event === "AdCompleted"){
	 console.log("AdCompleted");
  }
}

function fail(result)
{
 console.log(result);
}

Important Note : If you get the following error "Rewarded video ad failed to load: The display format in the ad request does not match the display format specified for this placement. Each placement can only be used with a single display format. You can create multiple placements in order to use multiple display formats.", please follow the steps to resolve the issue.

  1. You must have the Audience Network SDK integrated in your game
  2. Your app must have an active, approved Audience Network account with payment information.
  3. Game only: Your game app is active and added to your account.
  4. Ad position: You must already have a rewarded video ad unit in your game. Reference : https://stackoverflow.com/questions/50532615/facebook-rewarded-video-ad-failed-to-load

Methods 6

Show Video ads

Syntax

cordova.plugins.codeplayfacebookads.showRewardVideoAd("",success,fail);

Example

cordova.plugins.codeplayfacebookads.showRewardVideoAd("",options,success,fail);

function success(result)
{
 console.log(result);
}
function fail(result)
{
 console.log(result);
}

Support Platfrom

  • Android

Our Apps

https://play.google.com/store/apps/details?id=com.HTML.AngularJS.Codeplay

https://play.google.com/store/apps/details?id=sql.code.play

https://play.google.com/store/apps/details?id=html.editor.codeplay

https://play.google.com/store/apps/details?id=php.code.play

https://play.google.com/store/apps/details?id=cordova.code.play

https://play.google.com/store/apps/details?id=com.kids.learning.master

cordova-plugin-codeplay-facebookads-free's People

Contributors

kapilsriram avatar merbin2012 avatar

Watchers

 avatar

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.