All Projects → azerion → Phaser Ads

azerion / Phaser Ads

Licence: mit
A Phaser plugin for providing nice ads integration in your phaser.io game

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Phaser Ads

Phaser Es6 Webpack
A bootstrap project for create games with Phaser + ES6 + Webpack.
Stars: ✭ 1,266 (+1407.14%)
Mutual labels:  phaser, cordova
Framework7 Cli
Framework7 command line utility
Stars: ✭ 76 (-9.52%)
Mutual labels:  cordova
Carpoolear
The open source Vue.js frontend (mobile and cordova app) for the argentinian carpooling application: Carpoolear
Stars: ✭ 59 (-29.76%)
Mutual labels:  cordova
Games
一个基于Phaser的小游戏集合
Stars: ✭ 1,167 (+1289.29%)
Mutual labels:  phaser
Cordova Plugin Getuisdk
个推官方提供的推送SDK PhoneGap(Cordova) 插件(支持 Android & iOS)
Stars: ✭ 65 (-22.62%)
Mutual labels:  cordova
Phaser Ce
Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
Stars: ✭ 1,186 (+1311.9%)
Mutual labels:  phaser
Vue Mobile Mint
🍔 🍖 🍴基于mint-ui的饿了么外卖平台混合app(仿饿了么)
Stars: ✭ 59 (-29.76%)
Mutual labels:  cordova
Xgpush Cordova
腾讯信鸽推送 for Cordova
Stars: ✭ 78 (-7.14%)
Mutual labels:  cordova
Cordova Plugin Wechat
A cordova plugin, a JS version of Wechat SDK
Stars: ✭ 1,198 (+1326.19%)
Mutual labels:  cordova
Angular Pwa Seed
Multiplatform Angular project (Web/PWA, Mobile and Desktop) with Ionic (and optionally Bootstrap) - Sample: https://angular-pwa-seed.netlify.com
Stars: ✭ 68 (-19.05%)
Mutual labels:  cordova
Tus Js Client
A pure JavaScript client for the tus resumable upload protocol
Stars: ✭ 1,151 (+1270.24%)
Mutual labels:  cordova
Onsenui
Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.
Stars: ✭ 8,518 (+10040.48%)
Mutual labels:  cordova
Drip Ionic3
「水滴打卡」App Open Source Code Base On Ionic V3 Framework
Stars: ✭ 74 (-11.9%)
Mutual labels:  cordova
Easygameframeworkopen
基于Typescript的渐进式通用游戏前端开发框架
Stars: ✭ 65 (-22.62%)
Mutual labels:  phaser
Cordova Plugin Camera Preview Sample App
cordova-plugin-camera-preview Sample App
Stars: ✭ 76 (-9.52%)
Mutual labels:  cordova
Simple Ionic 3 App
A simple Ionic 3 app with get requests to a local JSON file. It showcases how to set up a simple service and provides some nice components for your own application.
Stars: ✭ 59 (-29.76%)
Mutual labels:  cordova
Cordovue
A sample Apache Cordova application using VueJS.
Stars: ✭ 66 (-21.43%)
Mutual labels:  cordova
Ionic Typescript Mdha Starter
📱 This is an boilerplate starter project I use to bootstrap mobile applications. It is built with Ionic, AngularJS, TypeScript, and runs in Cordova. It is built upon the Visual Studio Tools for Apache Cordova project provided in Visual Studio 2015.
Stars: ✭ 70 (-16.67%)
Mutual labels:  cordova
Framework7 Template Vue Simple
Deprecated! Simple Framework7 Vue starter app template in a single HTML file
Stars: ✭ 81 (-3.57%)
Mutual labels:  cordova
Sentry Wizard
Sentry Project Setup Wizard
Stars: ✭ 78 (-7.14%)
Mutual labels:  cordova

IMPORTANT NOTE

This repository is to be considered DEPRECATED and all efforts are going towards developing the next version of the Ad Wrapper in azerion/h5-ad-wrapper.

npm version jsDelivr Hits

Phaser Ads

This Phaser plugin that allows you to leverage different ad providers whilst providing the same simple API. Also allows you to easily integrate mobile ads (via Cocoon).

Key features:

  • Ads for your mobile web experience
  • Pluggable ad providers
  • Gamedistribution.com
  • IMA3 SDK
  • Cocoon.io (support for AdMob/HeyZap/MoPub/Chartboost)
  • HeyZap for Cordova
  • Integrates nicely into Phaser
  • Fullscreen ad support

Getting Started

First you want to get a fresh copy of the plugin. You can get it from this repo or from npm.

npm install @azerion/phaser-ads

Next up you'd want to add it to your list of js sources you load into your game:

<script src="path/to/phaser-ads.min.js"></script>

You could also opt for using the (free) jsdelivr cdn:

<script src="https://cdn.jsdelivr.net/npm/@azerion/[email protected]/build/phaser-ads.min.js"></script>

After adding the script to the page you can activate it by enabling the plugin:

game.add.plugin(PhaserAds.AdManager);

Usage

First thing you need to do after loading the plugin is attaching a provider to the adManager. PhaserAds comes pre-compiled with 4 providers for you to choose from:

Gamedistribution.com

If you already have an account on Gamedistribution.com you can skip this introduction if not, head on over to gamedistribution.com and sign up for a free account. Once you're signed up you can check out this guide for settings up a game. This is important because this will supply you with a gameId, which you need to supply to the plugin.

So when you have your gameId you can start by registering the provider to the plugin:

// Let's create a new provider, first argument should be the game, second should be the ad tag URL
var provider = new PhaserAds.AdProvider.GameDistributionAds(
   game,                                        // Your Phaser game instance
   '2d77cfd4b1e5487d998465c29de195b3'           // Your gameId
);
game.ads.setAdProvider(provider);

After this it's as easy as calling:

game.ads.showAd();

IMA SDK

A provider can use any number of arguments configured in order to make it work, it all depends on the implementation that was made by the developer. For our IMA Provider you can create one like this:

// Let's create a new provider, first argument should be the game, second should be the ad tag URL
var provider = new PhaserAds.AdProvider.Ima3(
   game,
   'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&correlator'
);
game.ads.setAdProvider(provider);

Now all you need to do is request an ad, and add an event listener that is called when the ad is completed/skipped/finished/done playing.

game.ads.onContentResumed.addOnce(function() {
    // This gets called when the ad is complete
    game.state.start('NextState');
});

// Here we request the ad
game.ads.showAd();

You can also send custom parameters by adding them as an object to the showAd function.

F.A.Q.

I Don't see any ads!

This can happen, sometimes the provider does something wrong, but most of the time (and when you are testing locally) your ads get blocked from showing. That's right, ads don't show when testing locally. The easiest way to avoid this is by testing your game on a server (online).

Another work around would be to adjust your /etc/hosts.

Why don't you support this ad provider!

The setup allows for a multitude of ad providers to work, but sadly we don't have the time and resources to add all of them. That beeing said, this plugin is on GitHub, and you're welcome to shoot in a PR to add a new provider =)

Disclaimer

We at Azerion just love playing and creating awesome games. We aren't affiliated with Phaser.io. We just needed some awesome ads in our awesome HTML5 games. Feel free to use it for enhancing your own awesome games!

Phaser Ads is distributed under the MIT license. All 3rd party libraries and components are distributed under their respective license terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].