![add new class to monogame visual studio 2017 add new class to monogame visual studio 2017](https://i1.wp.com/www.mooict.com/wp-content/uploads/2017/03/word-image-75.png)
- Add new class to monogame visual studio 2017 how to#
- Add new class to monogame visual studio 2017 install#
- Add new class to monogame visual studio 2017 full#
ad was clicked on so you just made moneyĪnd Here is how I called it as an example from MonoGame Game1.cs /// Public void OnRewardedVideoAdLeftApplication()
![add new class to monogame visual studio 2017 add new class to monogame visual studio 2017](https://community.monogame.net/uploads/default/original/2X/2/242a3b902a11590c1f2c4f9c34dc6fbe95510016.png)
error message if you want will be ignored otherwise Public void OnRewardedVideoAdFailedToLoad(int errorCode) you can use the reward variable to handle your own rewardsĪ(AdController.adID2,new AdRequest.Builder().Build()) Public void OnRewarded(IRewardItem reward) constructor, up to you if you need to do anything in here Internal class ListeningReward : AdListener, IRewardedVideoAdListener * Description : Listening class for the reward ad Internal class ListeningRegular : AdListenerĪ(new AdRequest.Builder().Build()) * Description : Listening class for the regualr ad RewardHandle.LoadAd(adID2,new AdRequest.Builder().Build()) // load the first oneĪdRewardLoaded = false // reset triggers RewardHandle.RewardedVideoAdListener = listening // point to the rewards Listen class RewardHandle.UserId = appID // set the App ID RewardHandle = MobileAds.GetRewardedVideoAdInstance(Game1.Activity) // initialize the handle
![add new class to monogame visual studio 2017 add new class to monogame visual studio 2017](https://i.imgur.com/9jQY7El.png)
ListeningReward listening = new ListeningReward() // create a pointer to our listen class InterstitialHandle.LoadAd(new AdRequest.Builder().Build()) InterstitialHandle.AdListener = listening ListeningRegular listening = new ListeningRegular() InterstitialHandle.AdUnitId = adID1 // adID string, can repoint this on the fly InterstitialHandle = new InterstitialAd((Activity1)Game1.Activity) MobileAds.Initialize(Game1.Activity,appID) // initialize the ads * interstitialRegular.AdUnitId to point to another adIDx * if you need to change the adID, just set
Add new class to monogame visual studio 2017 full#
* Description : Initialize a regular full page ad
![add new class to monogame visual studio 2017 add new class to monogame visual studio 2017](http://rbwhitaker.wdfiles.com/local--files/monogame-project-template/ProjectSetup.png)
Public static bool adRewardLoaded = false Public static bool adRegularLoaded = false AD ID's This is a test use yours from Admob APP ID This is a test use yours from Admob Public static IRewardedVideoAd rewardHandle = null Public static InterstitialAd interstitialHandle = null / Only then can ads be added to the project Here is the complete code for the Class using Next Make a new Class Call it what ever you want, I called Mine AdController my NameSpace/Project was also called AdController so don’t forget to change the namespace to yours Heres and example of MY FULL Manifest xml version="1.0" encoding="utf-8"?> Insert the following via editing the Android Manifest.xml If its a new Project, create an Android manifest (Right Click project->Prooperties->Android Manifest->Create)
Add new class to monogame visual studio 2017 install#
Here it is.įirstly after creating your Android App Open “Manage NuGet Packages” (Right click project->Manage NuGet Packages)īrowse search for this “” and install it
Add new class to monogame visual studio 2017 how to#
For a VERY long time a bunch of people have been asking how to integrate Admob into there Android MonoGame Apps, After traveling around the Web and trying MANY examples, Most in Java and All NEVER a complete guide, I’ve completed the simplest and FULL example on how to do the simplest way possible using Visual Studio 2017 and the Latest Monogame 3.6 Dev.