Skip to content

MahmutCanGonul/Google-AdMob-Xamarin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Google-AdMob-Xamarin

Add advertise to Xamarin with Google AdMob

💣STEP BY STEP ADD ADVERTISE ON XAMARIN APPLICATION

Step 1: Create Google Admob account for your Google Play Application admob1

Step 2: Choose your advertise type admob2

Step 3: Create Keys for your Google Play app admob3

Now Let's go Visual Studio:

Step 4: We need to download MarcTron.Admob Package on your project : [Package Name: MarcTron.Admob]

Step 5:

Setup for Android: ▶️In step 3.photo, first key we use in Android.xml file:

       <application>
    <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 --> This ID is Example
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-3940256099942544~3347511713"/>
</application>

You must write your key in android:value = "" part!

▶️ We need to write this code in MainActivity.cs script in OnCreate() Method:

    MobileAds.Initialize(ApplicationContext);

Note: Also need this => using Android.Gms.Ads;

Setup for IOS:

In Info.plist you need to add this code in part:

      <key>GADApplicationIdentifier</key>
      <string>ca-app-pub-3940256099942544~3347511713</string>
      <key>GADIsADManagerApp</key>
      <true/>

Open AppDelegate.cs Script and this code in FinishedLaunching() Method:

       MobileAds.SharedInstance.Start(CompletionHandler);
       
       // Create a CompletionHandler Method
       private void CompletionHandler(InitializationStatus status)
       { 
       
       }

Last Step: Open your Xaml page and also in ContentPage Like this:

      <ContantPage xmlns:s="clr-namespace:MarcTron.Plugin.Controls;assembly=Plugin.MtAdmob">

Then write in ContantPage this Code and also look at step 3 beacuse we use this keys:

      <admob:MTAdView AdsId="ca-app-pub-3940256099942544/6300978111"/>

🥇Well Done your advertise is ready!! Now make money 🤑🤑🤑🤑🤑

About

Add advertise to Xamarin with Google AdMob

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published