Coder Social home page Coder Social logo

s1021577987 / unity5-admob-with-mediation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pescode/unity5-admob-with-mediation

0.0 1.0 0.0 214.15 MB

Show Admob ads with mediation (interstitial & rewarded) from different providers like AdColony, AppLovin, Chartboost, Facebook Audience Network, UnityADS & Vungle

C# 22.76% Ruby 0.01% Objective-C 76.73% C 0.50%

unity5-admob-with-mediation's Introduction

Unity5-Admob-with-Mediation

Google Mobile Ads for iOS & Android with mediation. Interstitial & Rewarded Ads

Show Admob ads with mediation (interstitial & rewarded) from different providers like AdColony, AppLovin, Chartboost, Facebook Audience Network, UnityADS & Vungle

Current version 1.0.6

Updated to Google Mobile Ads 3.1.3 and SDK+Adapter mediation libs. Improvements and bug fixes. Added support for Banners.

Version 1.0.5

I've found that on Android we need to wait a little time before doing something in the game when the Ad close. I've added a coroutine in RshkAds.cs to avoid problem with this.

Version 1.0.4

Special notes: Google Mobile Ads 3.1.0 now includes a script called AdMobDependencies (Assets/PlayServicesResolver/Editor). I've commented the lines 67 - 74 because I wasn't able to prepare a build on iOS, I always receive an error with POD.

HOW TO USE

  • Download the lastest admobWithMediation.unitypackage from here: https://goo.gl/HnYYOQ. Import this package in your project.
  • The project contains the adaptors, sdk, manifest and xcode setup ready to use admob with AdColony, AppLovin, Chartboost, Facebook Audience Network, UnityADS and Vungle. You can write/use your own code to display ads or you can optionally use RshkAds.cs .
  • In case that you want to use RshkAds.cs, set your interstitial Ad Unit ID and rewarded Ad Unit ID for iOS and Android in RshkAds.cs (Line 48-52).
  • Drag and drop RshkAds prefab in you first scene (when the game launch, in your loading screen or in the first scene so it can start to fetch interstitials and rewarded ads ASAP).
  • To setup your APPLOVIN SDK KEY for Android OPEN Plugins/Android/RshkAds/AndroidManifest.xml . Add your SDK on line 39.
  • To setup your APPLOVIN SDK KEY for iOS OPEN Editor/PostBuildProcess.cs. Add your SDK on line 130.
  • If your want to use Facebook Audience Network setup your Facebook App ID and open Plugins/Android/RshkAds/AndroidManifest.xml. Add your ID on line 52 ex: fb123456789
  • To setup Facebook Audience Network on iOS open Editor/PostBuildProcess.cs and add your app name and id in lines 121, 124, 127
  • To display interstitial Ads just call RshkAds.ShowInterstitial() anywhere in your code. As soon as the ads closes in will fetch automatically another ad for you.
  • To use rewarded Ads you must do the following In your game logic, in the part where you want to know when the user has closed the rewarded ads and do something else (like give virtual coins or another revive) you must setup a listener like this
  • If you want to test, on iOS is pretty straighforward, you can open Test.scene and run. On Android you will have to setup Google Play Games Services first, the plugin version compatible and tested with this is available in releases folder.

void OnEnable() { RshkAds.OnRewardedCompleted += YourFunctionToDoSomething; }

void OnDisable() { RshkAds.OnRewardedCompleted -= YourFunctionToDoSomething; }

void YourFunctionToDoSomething() { // reward the player HERE! }

Before showing your special button like WATCH AD FOR 50 COINS or CONTINUE GAME you probably want to know if there is a RewardedAD ready to show... to know that just call the function that returns a boolean

RshkAds.IsRewardedAdsAvailable()

To show the rewarded AD call

RshkAds.ShowRewarded()

  • If you want to display banner just call RshkAds.ShowBanner();

To hide banner RshkAds.HideBanner();

To destroy a banner (if you want Admob to try to load from another network) RshkAds.DestroyBanner();

Plugins

iOS

ANDROID

NOTE

If you receive something like "The imported type `Google.JarResolver.PlayServicesSupport' is defined multiple times" just delete JarResolverLib

unity5-admob-with-mediation's People

Contributors

pescode avatar

Watchers

sxcl 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.