Coder Social home page Coder Social logo

marcojak / mtadmob Goto Github PK

View Code? Open in Web Editor NEW
160.0 160.0 28.0 1.58 MB

Admob plugin for Xamarin Android and iOS

Home Page: https://www.xamarinexpert.it/admob-made-easy/

admob admob-plugin google-admob google-ads xamarin xamarin-android xamarin-forms xamarin-ios xamarin-library

mtadmob's People

Contributors

aswinpg avatar k232 avatar marcojak avatar mfrappat avatar ngumby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtadmob's Issues

Sample project errors on both Android and iOS with latest Xamarin forms (4.3.0.947036)

Describe the bug
Using the latest sample project causes errors on each different platform.
Android (at runtime) with "Java.Lang.RuntimeException: 'Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: "

iOS with "framework not found GoogleSignIn SampleMTAdmob.iOS linker command failed with exit code 1"

To Reproduce
Steps to reproduce the behavior:

  1. Update clean sample project to latest Xamarin forms (4.3.0.947036)
  2. Try to build for android and iOS
    3.Andriod fails at runtime - iOS fails at build.
  3. See different error on each platform

Expected behavior
No errors on each platform (Android and iOS)

Video interstitials now showing when app was pubished to Google Play

Describe the bug
Video interstitials (Interstitial with reward. New AdMob feature) now showing when the app was published to Google Play. Regular interstitial worked as well, but video not appearing. My account is valid for more than a year. Both interstitial ads (video and regular) were created more than a week ago. The release of a new version of the app was also more than a week ago. Also, the test id for video interstitial is working.

To Reproduce
Steps to reproduce the behavior:

  1. Publish the app with video interstitial to Google Play
  2. To see that ads are not appearing

Expected behavior
Video interstitial is working

Smartphone (please complete the following information):

  • Device: Redmi 8
  • OS: Android 10

'Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider' Error on start

Describe the bug
Java.Lang.RuntimeException: 'Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:

To Reproduce
Steps to reproduce the behaviour:

  1. Start Debug
  2. The error appears in break mode.

Expected behaviour
I expected the application to run and the banner ad to appear on the page selected.

Screenshots
N/A. Error message provided.

Desktop (please complete the following information):

  • OS: Android
  • Version 9

Smartphone (please complete the following information):

  • Device: OnePlus 7 Pro
  • OS: Android 10

Xamarin.Google.iOS.SignIn still necessary?

With Xamarin.Google.iOS.SignIn 4.4.0, I was not able to upload the ipa to Apple. I always get the following error message:

Dear Developer,

We identified one or more issues with a recent delivery for your app. Please correct the following issues, then upload again.

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Best regards,

The App Store Team

I've added the mtouch parameter as described by Gerald in UIWebView Deprecation and Xamarin.Forms, but I still got this message :-(

I've tried to use latest Xamarin.Google.iOS.SignIn 5.0.2.1 but got several errors during compiling. So I've completely removed Xamarin.Google.iOS.SignIn from my iOS project. And app compiles fine and ads are displayed (as far as I see). Is there any reason to install Xamarin.Google.iOS.SignIn in the iOS project? It's described in your linked blog article at https://www.xamarinexpert.it/admob-made-easy/ e.g. in section "iOS Project (Important)" so I've added it. Maybe it's not necessary anymore? If so, is Xamarin.Google.iOS.MobileAds still necessary to add manually? I've currently latest 7.57.0 in use and it works fine.

Many thanks!

Android Application_Id

I'm trying to add your package to my app. According to your description, I need to add this line to AndroidManifest:

 <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>

The ca-app-pub is probably the same as I entered already in MobileAds.Initialize, but what is the APPLICATION_ID ? I also checked your Sample AndroidManifest.xml but did not find the key there?

MTAdView created by C# doesn't work on iOS

Describe the bug
If I add an MTAdView to a grid like that:

MTAdView banner = new MTAdView
{
AdsId = AdMobRepo.BannerUnitId,
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
BackgroundColor = Color.Red
};
MainGrid.Children.Add(banner, 0, 1);

the banner doesn't show on iOS. On Android it's working fine.
The BackgroundColor just for to be certain that the view is added to the grid. It is, but the ad is not.
With XAML it's working in iOS too.

To Reproduce
After the setting up according to the readme, in a brand new Xamarin project change the default StackLayout to Grid, add to RowDefinition and name it to MainGrid, then copy the code above into the MainPage.xaml.cs' constructor.
Add a valid banner unit id.

Expected behavior
The ad is shown under the default Hello Xamarin! text.

Smartphone (please complete the following information):

  • Device: iPhone SE, iPad 2018
  • OS: 13.3.1

[Regression] [Android] Build failed after update from 1.6.0 to 1.6.1

Describe the bug
After update from 1.6.0 to 1.6.1 it is impossible to build my working fine solution for Android anymore (for iOS everting seems to be fine). Same problem appears in Release and Debug, locally and in Microsoft App Center. Build stops at early stage with below error. Rolling back to 1.6.0 solves the problem.

_CompileToDalvik: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java -Xmx1G -classpath /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/r8.jar com.android.tools.r8.R8 --release --min-api 21 --output obj/Release/android/bin/ --lib /Users/runner/Library/Android/sdk/platforms/android-30/android.jar --lib /Users/runner/Library/Android/sdk/platforms/android-30/optional/org.apache.http.legacy.jar obj/Release/android/bin/classes.zip /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v11.0/mono.android.jar /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/java_runtime.jar /Users/runner/.nuget/packages/xamarin.androidx.annotation/1.1.0.8/buildTransitive/monoandroid90/../../jar/androidx.annotation.annotation.jar /Users/runner/.nuget/packages/xamarin.androidx.collection/1.1.0.6/buildTransitive/monoandroid90/../../jar/androidx.collection.collection.jar /Users/runner/.nuget/packages/xamarin.androidx.lifecycle.common/2.2.0.4/buildTransitive/monoandroid90/../../jar/androidx.lifecycle.lifecycle-common.jar /Users/runner/.nuget/packages/xamarin.androidx.arch.core.common/2.1.0.7/buildTransitive/monoandroid90/../../jar/androidx.arch.core.core-common.jar /Users/runner/.nuget/packages/xamarin.google.guava.listenablefuture/1.0.0.2/buildTransitive/monoandroid50/guava-listenablefuture.jar /Users/runner/.nuget/packages/xamarin.androidx.room.common/2.2.5.5/buildTransitive/monoandroid90/../../jar/androidx.room.room-common.jar obj/Release/lp/135/jl/classes.jar obj/Release/lp/132/jl/classes.jar obj/Release/lp/168/jl/classes.jar obj/Release/lp/157/jl/classes.jar obj/Release/lp/150/jl/classes.jar obj/Release/lp/159/jl/classes.jar obj/Release/lp/166/jl/classes.jar obj/Release/lp/161/jl/classes.jar obj/Release/lp/133/jl/classes.jar obj/Release/lp/134/jl/classes.jar obj/Release/lp/160/jl/classes.jar obj/Release/lp/158/jl/classes.jar obj/Release/lp/151/jl/classes.jar obj/Release/lp/169/jl/classes.jar obj/Release/lp/156/jl/classes.jar obj/Release/lp/174/jl/classes.jar obj/Release/lp/180/jl/classes.jar obj/Release/lp/173/jl/classes.jar obj/Release/lp/0/jl/formsviewgroup.jar obj/Release/lp/145/jl/classes.jar obj/Release/lp/142/jl/classes.jar obj/Release/lp/129/jl/classes.jar obj/Release/lp/45/jl/rxjava.jar obj/Release/lp/127/jl/classes.jar obj/Release/lp/143/jl/classes.jar obj/Release/lp/144/jl/classes.jar obj/Release/lp/172/jl/classes.jar obj/Release/lp/186/jl/classes.jar obj/Release/lp/181/jl/classes.jar obj/Release/lp/175/jl/classes.jar obj/Release/lp/126/jl/classes.jar obj/Release/lp/110/jl/auto-value-annotations.jar obj/Release/lp/43/jl/reactivestreams.jar obj/Release/lp/128/jl/classes.jar obj/Release/lp/153/jl/classes.jar obj/Release/lp/154/jl/classes.jar obj/Release/lp/162/jl/classes.jar obj/Release/lp/165/jl/classes.jar obj/Release/lp/131/jl/classes.jar obj/Release/lp/136/jl/classes.jar obj/Release/lp/138/jl/classes.jar obj/Release/lp/164/jl/classes.jar obj/Release/lp/163/jl/classes.jar obj/Release/lp/155/jl/classes.jar obj/Release/lp/152/jl/classes.jar obj/Release/lp/139/jl/classes.jar obj/Release/lp/137/jl/classes.jar obj/Release/lp/130/jl/classes.jar obj/Release/lp/184/jl/classes.jar obj/Release/lp/170/jl/classes.jar obj/Release/lp/177/jl/classes.jar obj/Release/lp/183/jl/classes.jar obj/Release/lp/148/jl/classes.jar obj/Release/lp/141/jl/classes.jar obj/Release/lp/4/jl/mimecraft-1.1.1.jar obj/Release/lp/4/jl/jcodec-0.1.9.jar obj/Release/lp/146/jl/classes.jar obj/Release/lp/179/jl/classes.jar obj/Release/lp/147/jl/classes.jar obj/Release/lp/178/jl/classes.jar obj/Release/lp/140/jl/classes.jar obj/Release/lp/182/jl/classes.jar obj/Release/lp/176/jl/classes.jar obj/Release/lp/149/jl/classes.jar obj/Release/lp/171/jl/classes.jar obj/Release/lp/185/jl/classes.jar obj/Release/lp/9/jl/bin/classes.jar obj/Release/lp/11/jl/bin/classes.jar obj/Release/lp/7/jl/bin/classes.jar obj/Release/lp/42/jl/bin/classes.jar obj/Release/lp/6/jl/bin/classes.jar obj/Release/lp/44/jl/bin/classes.jar obj/Release/lp/112/jl/bin/classes.jar obj/Release/lp/115/jl/bin/classes.jar obj/Release/lp/4/jl/bin/classes.jar obj/Release/lp/15/jl/bin/classes.jar obj/Release/lp/3/jl/bin/classes.jar obj/Release/lp/12/jl/bin/classes.jar obj/Release/lp/114/jl/bin/classes.jar obj/Release/lp/113/jl/bin/classes.jar obj/Release/lp/2/jl/bin/classes.jar obj/Release/lp/5/jl/bin/classes.jar --pg-conf /Users/runner/Library/Android/sdk/tools/proguard/proguard-android.txt --pg-conf obj/Release/proguard/proguard_xamarin.cfg --pg-conf obj/Release/proguard/proguard_project_references.cfg --pg-conf obj/Release/proguard/proguard_project_primary.cfg --pg-conf custom_proguard.cfg --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.versionedparcelable/1.1.1.6/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.lifecycle.runtime/2.2.0.4/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.core/1.3.2.1/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.savedstate/1.1.0.4-alpha01/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.lifecycle.viewmodel/2.2.0.4/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.lifecycle.viewmodelsavedstate/2.2.0.4/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.fragment/1.2.5.4/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.basement/117.5.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement.base/118.0.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement.sdk.api/118.0.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement.impl/117.4.1/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement.sdk/117.4.1/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.base/117.1.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.firebase.components/116.0.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.firebase.common/119.3.0/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement.api/117.4.1/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.googleplayservices.measurement/117.4.1/build/MonoAndroid90/../../proguard/MonoAndroid90/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.room.runtime/2.2.5.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.work.runtime/2.4.0/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.recyclerview/1.1.0.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.vectordrawable.animated/1.1.0.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.transition/1.3.1.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.coordinatorlayout/1.1.0.6/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.appcompat/1.2.0.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.google.android.material/1.1.0.5/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.media/1.2.1.1/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf /Users/runner/.nuget/packages/xamarin.androidx.mediarouter/1.2.1/buildTransitive/monoandroid90/../../proguard/proguard.txt --pg-conf obj/Release/aapt_rules.txt --pg-conf /Users/runner/.nuget/packages/xamarin.forms/5.0.0.1931/buildTransitive/MonoAndroid10/proguard.cfg Error in obj/Release/lp/174/jl/classes.jar:com/google/android/gms/internal/measurement/zzbo.class: Type com.google.android.gms.internal.measurement.zzbo is defined multiple times: obj/Release/lp/174/jl/classes.jar:com/google/android/gms/internal/measurement/zzbo.class, obj/Release/lp/186/jl/classes.jar:com/google/android/gms/internal/measurement/zzbo.class Compilation failed /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.D8.targets(51,5): error MSB6006: "java" exited with code 1. [/Users/runner/work/1/s/TipCalculator/TipCalculator.Android/TipCalculator.Android.csproj] Done Building Project "/Users/runner/work/1/s/TipCalculator/TipCalculator.Android/TipCalculator.Android.csproj" (PackageForAndroid;SignAndroidPackage target(s)) -- FAILED. Build FAILED.

To Reproduce
Steps to reproduce the behavior:

  1. Update nuget from 1.6.0 to 1.6.1
  2. Build solution for Android.

Expected behavior
Build completes without error.

Sample SecondPage.xml needs small update

Thanks for the good work. After two days of struggling with AdMob, your sample is the first that works for me.
I only had to fix a small detail:

In the sample code, in SecondPage.xaml.cs the NextPage function is missing:
private void NextPage(object sender, EventArgs e)
{
DisableEvents();
Navigation.PushAsync(new SecondPage());
}

Either that, or the Next Page button should be removed from SecondPage.xaml.

IsEnabled flag does not hide ads area

With introduction of the IsEnabled flag (thank you very much btw), ads are disabled when the flag is set to false. However, the area reserved for the ad is still visible but should be hidden.

iOS app doesn't build, GTMAppAuthFetcherAuthorization error. Android app is fine and running.

Hello,

For Android it's all fine. For iOS, app doens' build (using Visual Studio for Mac).

I'm using latest version, 1.6.
Added it to my iOS application, added references to Xamarin.Google.iOS.MobileAds 7.66.0 and Xamarin.Google.iOS.SignIn 5.0.2.1. Followed yours instructions to initialize everything, but when I try to build and run in emulator, I get these errors:

/Users/user184782/Projects/DonegalWeatherChannelApp/src/DWCApp/DWCApp/DWCApp.iOS/MTOUCH: Error MT5211: Native linking failed, undefined Objective-C class: GTMAppAuthFetcherAuthorization. The symbol 'OBJC_CLASS$_GTMAppAuthFetcherAuthorization' could not be found in any of the libraries or frameworks linked with your application. (MT5211) (DWCApp.iOS)

Would you have any idea or suggestion?

Thanks for time 👍

How to show interstitials

HI Marco,
to show interstitials there are 2 lines of code:

  • CrossMTAdmob.Current.LoadInterstitial("xx-xxx-xxx-xxxxxxxxxxxxxxxxx/xxxxxxxxxx");
  • CrossMTAdmob.Current.ShowInterstitial();

As seen in your sample, ShowInterstitial does not work as long as LoadInterstitial is not called and completed. So what would be the proposed usage within an app? Typically I just want to say "ShowInterstitial" and that's it, as shown in your linked blog post. But that's not working, as ShowInterstitial does not take any parameters anymore.

So what's the proposed way then?

  • Subscribe to OnInterstitialLoaded on my Page
  • LoadInterstitial
  • Within OnInterstitialLoaded, call ShowInterstitial
  • Unsubscribe from OnInterstitialLoaded as soon as I leave my page

Is that the best way to do it?

add UWP support

please add support for UWP- Apps since MS is shutting down there platform in june.

Kind regards,

Martin

AdsImpression Event Not Working

// XAML
<controls:MTAdView AdsImpression="ad1_AdsImpression"  x:Name="ad1" AdsId="xxxxxxxxxxxxxxxxx" PersonalizedAds="True" > 
</controls:MTAdView>

// Code Behind 
private void ad1_AdsImpression(object sender, EventArgs e)
{
   // count Impression 
}

I add AdsImpression Event But its Not hit i see impressions on admob accounts.

Black Banner and Intertitial

My banner and interstitial are showing but they are just black. The emplacements are showing but it's just black no image or text on the ads

1 - I tested on a real device ( same issue )
2 - I tested on emulator (same thing )

My manifest is :

My MainActivity.cs
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(savedInstanceState);
        Xamarin.Essentials.Platform.Init(this, savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
        MobileAds.Initialize(this);
        LoadApplication(new App());
    }

This is how the ads shows :

image
image

My Nugget :

image

Advert triggers fine on IOS and Android version 9 but on 10 i get an error and then crashes with "Uncaught TypeError: Cannot read property 'style' of null"

Describe the bug
Advert triggers fine on IOS and Android version 9 but on 10 i get an error and then crashes with "Uncaught TypeError: Cannot read property 'style' of null"

if I remove the advert then the app runs OK

Full Error Logs
[AudioManager] Use of stream types is deprecated for operations other than volume control
[AudioManager] See the documentation of requestAudioFocus() for what to use instead with android.media.AudioAttributes to qualify your playback use case
[Ads] HTTP timeout: 60000 milliseconds.
[libprocessgroup] set_timerslack_ns write failed: Operation not permitted
[libprocessgroup] set_timerslack_ns write failed: Operation not permitted
[Ads] JS: Uncaught TypeError: Cannot read property 'style' of null (https://imasdk.googleapis.com/admob/sdkloader/production/video_en.js:96)
[chromium] [INFO:CONSOLE(96)] "Uncaught TypeError: Cannot read property 'style' of null", source: https://imasdk.googleapis.com/admob/sdkloader/production/video_en.js (96)
[EGL_emulation] eglQueryContext 32c0 EGL_BAD_ATTRIBUTE
[EGL_emulation] tid 10726: eglQueryContext(1902): error 0x3004 (EGL_BAD_ATTRIBUTE)
[cr_MediaCodecBridge] create MediaCodec video decoder, mime video/avc
[OMXClient] IOmx service obtained
[MediaCodec] MediaCodec will operate in async mode
[SurfaceUtils] connecting to surface 0xa58e5008, reason connectToSurface
[MediaCodec] [OMX.google.h264.decoder] setting surface generation to 10874882
[SurfaceUtils] disconnecting from surface 0xa58e5008, reason connectToSurface(reconnect)
[SurfaceUtils] connecting to surface 0xa58e5008, reason connectToSurface(reconnect)
[ACodec] [OMX.google.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
[EGL_emulation] eglMakeCurrent: 0xe321ab40: ver 2 0 (tinfo 0xe320fd20)
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b49
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b49
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b4b
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b4b
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b4a
[eglCodecCommon] glUtilsParamSize: unknow param 0x00008b4a
[eglCodecCommon] setVertexArrayObject: set vao to 1 (1) 5 0
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 10668 (RenderThread), pid 10620

To Reproduce
Steps to reproduce the behavior:

Publish the app with video interstitial to Google Play
To see that ads are not appearing

Expected behavior
Video interstitial is working

Smartphone (please complete the following information):
Using 1.6.1
OS: Android 10

Native Ads

Are there any plans to add support for Native / Native Advanced ads in AdMob? If there is already support, could the README be updated for implementation?

Great plugin, thank you very much for your hard work!

iOS SSV issue

Hi! I use this plugin for showing rewarded ads and everything works great, but I don't receive SSV callbacks from Google if rewarded ad was viewed on iOS. I use the same code for both Android and iOS and also the same callback URI but as far as I can say google doesn't send callbacks at all so I can't reward iOS users for watching. Should I implement something extra for iOS?

Thanks in advance!

P.S. Test callbacks from AdMob are working properly.

Ad'd not showing on device

Describe the bug
This is probably more of a configuration issue then a bug. The Ad's only show on my emulator, and when they show they have a small "test" banner across the top of them. When i deploy the app to a test android phone, no ad's show at all.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

on device
go to xamarin forms page, dont see banner ad

on emulator
go to xamarin forms page, see banner ad
Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] Samsung Galaxy 7
  • OS: [e.g. iOS8.1] on device - Android 7, 8, on emulater pixel 3 Android 9, 10
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

example of code
The MTAdView has been added XAML of the page I want to show the ad's on.


 <controls1:MTAdView PersonalizedAds="true" AdsId="ca-app-pub-MY/Key" AdsClicked="MTAdView_OnAdsClicked"
                                    AdsClosed="MTAdView_AdsClosed" 
                                    AdsImpression="MTAdView_AdsImpression" 
                                    AdsOpened="MTAdView_AdsOpened" />

First MTAdView element to add does not seem to be visible

When adding a MTAdView element per Code, it doesnt appear anywhere. If I add a second element to the StackLayout, one MTAdView appears. In the list of Children in the stacklayout there are two MTAdViews listed, only one is displayed.

Code:

 <StackLayout x:Name="playerbarVertical">
            <StackLayout Orientation="Horizontal" Margin="0,10,0,0" x:Name="playerbar">

                <local:TestEditor x:Name="tb_playerName" HorizontalOptions="FillAndExpand" 
                Text="" FontFamily="Comfortaa" 
                Margin="0" PlaceholderColor="#AAA89E" Placeholder="{x:Static resources:AppResources.Spieler}" TextColor="#FFFFFF" />
                <Button  xmlns:forms="http://xamarin.com/schemas/2014/forms/design"
                         BackgroundColor="#e25822"  FontFamily="Comfortaa"
               Text="+" CornerRadius="20" x:Name="b1" TextColor="#003049" Clicked="b1_Clicked" HorizontalOptions="EndAndExpand" VerticalOptions="Fill" WidthRequest="50" />
                <Button  FontFamily="Comfortaa" CornerRadius="20" Text="Start" TextColor="#003049" BackgroundColor="#e25822" x:Name="startGame" Clicked="startGame_Clicked" Padding="0" Margin="0,0,10,0" BorderWidth="-1" />
            </StackLayout>
         
        </StackLayout>


private void b1_Clicked(object sender, EventArgs e)
        {
           
                MTAdView ads = new MTAdView();
                ads.AdsId = "ca-app-pub-3940256099942544/6300978111";
                ads.MinimumHeightRequest = 1000;
                ads.MinimumWidthRequest = 200;
                Label l = new Label() { Text = "test" };
                playerbarVertical.Children.Add(l); //appears at first call
                playerbarVertical.Children.Add(ads); //appears only at second call
            }

Happens on Mi 8 Android 10, I havent tested in on other devices yet.

1.5.8 update doesn't show ads

Describe the bug
Dear Team,
After final update of 1.5.8 no banner ads show on both ios or android version

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Update google admob sdk for android 11

In the release notes of google admob sdk, it's mentionned that SDK versions 19.3.0 and lower do not support Android 11 (API 30).
MTAdmob is still using version 19.1.0 of the sdk.
Could you please update the dependency ?
Thanks.

AdSize

Hi,

Beside SmartBanner, can it support other types of AdSize?

Thanks,

Space on Android

I have this log on console output on Android devices. It's works fine on iOS.

Not enough space to show ad. Needs 411x49 dp, but only has 371x49 dp.

Any idea?

ps: Thank you for you amazing job and stay safe!

Doesn't work on Xamarin Forms in iOS

Describe the bug
It doesn't work on iOS, it doesn't compile in Release mode. In debug mode, the ads don't show.

To Reproduce
Steps to reproduce the behavior:

  1. Add the nuget package (and another 2 nugets from Google, followin some tutorials without success).
  2. Change to Release mode.
  3. Archive the iOS project.
  4. Get a lot of errors!!

Expected behavior
To archive successfully to generate the ipa file.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):
Lastest VS (in Windows) and macOS version, all the lastest version nugets.

Smartphone (please complete the following information):

  • Any device.

iOS build error after update from 1.5.8 to 1.6.0

Describe the bug
After update from 1.5.8 to 1.6.0 I can't build debug or release configuration anymore (both locally and in Microsoft App Center). Downgrade to 1.5.8. solves the problem.

In App Center logs I can see:

_CompileToNative:
2020-11-09T12:25:30.6203030Z   /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/response-file.rsp --optimize=experimental-xforms-product-type "--gcc_flags=-ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz" 
2020-11-09T12:25:31.4484760Z   Xamarin.iOS 14.0.0.0 (xcode12): 7ec3751a1 using framework: /Applications/Xcode_12.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk
2020-11-09T12:25:37.3224190Z   Process exited with code 3, command:
2020-11-09T12:25:37.3226300Z   /usr/bin/unzip System.String[]
2020-11-09T12:25:37.3294910Z MTOUCH : error [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip]: start of central directory not found; [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj]
2020-11-09T12:25:37.3296540Z     zipfile corrupt.
2020-11-09T12:25:37.3296900Z     (please check that you have transferred or created the zipfile in the
2020-11-09T12:25:37.3297460Z     appropriate BINARY mode and that you have compiled UnZip properly)
2020-11-09T12:25:37.3299010Z   Archive:  /Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip
2020-11-09T12:25:37.3299390Z   
2020-11-09T12:25:40.2261310Z MTOUCH : error MT1303: Could not decompress the native framework 'FBLPromises.framework' from '/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip'. Please review the build log for more information from the native 'unzip' command. [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj]
2020-11-09T12:25:40.2263420Z   		
2020-11-09T12:25:40.4956100Z Done Building Project "/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj" (Rebuild target(s)) -- FAILED.
2020-11-09T12:25:40.5382030Z 
2020-11-09T12:25:40.5385460Z Build FAILED.

To Reproduce
Steps to reproduce the behavior:

  1. Update working solution to 1.6.0
  2. Start Build

Access to info if ad was recived.

Is your feature request related to a problem? Please describe.
I want to show a placeholder with a custom image when the ad is not loaded. Something as described here
https://ads-developers.googleblog.com/2012/06/show-custom-image-when-no-admob-ad-is.html but to do this I need access to information if the ad is already loaded. if I just put the image under the ad view, it works fine until the ad with a transparent background appears, so I need to hide the placeholder when it is not necessary).

Describe the solution you'd like
It would be perfect to have access to function and event similar like with other types of ads, something like
CrossMTAdmob.Current.IsAdLoaded();
CrossMTAdmob.Current.OnAdStatusChanged;

Describe alternatives you've considered
Maybe I missed something and there is an easier way to achieve it? If so, can you give me a hint? OK, I find alternative solution, just use AdsImpression event, to hide the placeholder. Seems to work fine.

Thank you for help and very nice plugin!

Banner on android is not displayed on start

Describe the bug
Banner on android is not displayed on start. Starts working only when interstitial is shown.

To Reproduce

  1. Make a banner in XAML
  2. Build on Android

Expected behavior
Banner appeared

Actual behavior
Banner is empty

Smartphone (please complete the following information):

  • Device: NOX Player
  • OS: Android 5.1
  • Version of plugin 1.5.8

Additional context
After calling interstitial ad, the banner immediately appears, so i do not know, where the problem actually is.
iOS is ok

IOS ads not show

Hello. I have a problem with my IOS app. Ads on android works very well, but recently I've published IOS app to the app store and admob ads doesn't show. I've done:

  1. I've added those lines to my Info.plist
    <key>GADApplicationIdentifier</key>
    <string>...my admob app code...</string>
    <key>GADIsAdManagerApp</key>
    <true/>
    <key>SKAdNetworkItems</key>
    <array>
    <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>cstr6suwn9.skadnetwork</string>
    </dict>
    </array>

  2. I initialized plugin in AppDelegate

MobileAds.SharedInstance.Start(CompletionHandler);

private void CompletionHandler(InitializationStatus status) { }

When I use google sample app unit IDs everything works fine. When I paste my IDs from admob console, I can see ads requests in console but there are no impressions. I've done every steps from your instruction and from google admob guide, but I have no idea why my ads doesnt show, maybe I miss something.

Ad not showing

Hi
I added the style to app.xaml but the banner is style not showing :


<Application.Resources>

<Style x:Key="admobStyle" TargetType="controls:MTAdView">

<Setter.Value>
<x:OnIdiom Phone="50" Tablet="90"/>
</Setter.Value>

</Style>

</Application.Resources>
on my page i have 👍
<StackLayout>

    <controls:MTAdView Style="{StaticResource admobStyle}" IsVisible="true" PersonalizedAds="true" AdsId="myownAdid"/>


    <Label Text="Start developing now" FontSize="Title" Padding="30,10,30,10"/>
    
</StackLayout>
Thanks

[QUESTION] Loading and Showing Rewarded Ad

  1. Does the rewarded ad id always need to be specified twice with both
MTAdView ads = new MTAdView();
ads.AdsId = "xx-xxx-xxx-xxxxxxxxxxxxxxxxx/xxxxxxxxxx";

and

CrossMTAdmob.Current.LoadRewardedVideo("xx-xxx-xxx-xxxxxxxxxxxxxxxxx/xxxxxxxxxx");

?

Or is MTAdView.adsId (and CrossMTAdmob.Current.AdsId) only for banner ad ids? If so, does that mean I can create an MTAdView() without giving it an AdsId? Or do I not need to create a new MTAdView() at all?

  1. How long does LoadRewardedVideo() usually take? Can it be loaded on the fly when the user chooses to earn a reward or does it need to be loaded when the app starts because it takes a while?

Sorry I am new to ad integration, and I am a bit confused. I am unable to see an ad after calling both LoadRewardedVideo() and ShowRewardedVideo() with the test ids, so I just want to make sure I'm developing correctly. There were no compilation/deployment errors.

Thanks for providing a cross-platform solution for AdMob!

Mocking Current for Unit Tests

What is the recommended way for unit testing this?

I usually mock out the Current interface, but it is read-only for this plugin and thus cannot be set.

CrossMTAdmob.Current = Substitute.For<MarcTron.Plugin.Interfaces.IMTAdmob>();

Screen Shot 2021-02-28 at 4 08 44 PM

Crash in release mode if rewarded ads are used

If rewarded ads are used, app fails in release mode with fatal exception:

java.lang.NoSuchMethodError: no non-static method "Lcom/google/android/gms/internal/ads/zzatk;.setRewardedVideoAdListener(Lcom/google/android/gms/ads/reward/RewardedVideoAdListener;)V"

Video interstitials hang on devices lower than iOS 14

Describe the bug
When I use your sample project, and insert one of the AdMob test ads for "interstitial video", the add hangs on devices lower than iOS 14.

You can see the video "area" inside the add "spinning" and trying to load the content.

If I run the same sample on iOS 14+ device, everything works.

To Reproduce
Steps to reproduce the behavior:

  1. Use this ad string in the load "video "interstitial" ad : "ca-app-pub-3940256099942544/5135589807" (from admob official pages)
  2. Try running on iOS 14+ simulator, and video ad works.
  3. Try running on iOS 13 simulator, and video spins/hangs

Expected behavior
Video should just load and start playing like under IOS 14

Smartphone (please complete the following information):

  • Device: iOS 13 and iOS14 devices

Additional context
I have the same issue inside my app, but after testing on your sample project I can see that the issue remains inside that too.

Problem with Facebook Audience Network mediation.

Describe the bug
I'm trying to setup Facebook Audience Network mediation. In AdMob configuration panel all seems to be fine, but I don't see Facebook ads in app (AdMob ads works fine). There is error in console

<Google> Cannot find an ad network adapter with the name(s): GADMAdapterFacebook. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.

To Reproduce
Implement MTAdmob banner in iOS app. Create mediation group in AdMob configuration panel. Facebook ads not appears but there is an error in console.

Expected behavior
I believe it may be not exactly plugin problem, just needs to add an additional dependency, but I can't find anything working together with plugin, so any advice would be great.

Thank you!

'MobileAds.Initialize(Context, string)' is obsolete: 'deprecated'

Describe the bug
Getting this warning when building for Android:

CS0618 'MobileAds.Initialize(Context, string)' is obsolete: 'deprecated'

Still builds, but might be a problem in the future.

To Reproduce
Steps to reproduce the behavior:

Initialise in MainActivity:
MobileAds.Initialize(ApplicationContext, "ca-app-pub-xxxxxxxxxxxxxxxxxx~xxxxxxxxxxx");

Reward Video shows instead of interstitial.

Describe the bug
When I call CrossMTAdmob.Current.ShowInterstitial(); a RewardedVideo shows

To Reproduce
On App start, I

  1. Get current
  2. Load interstitial (so it's ready)
  3. Load a rewarded video
  4. After show, I call in OnClosed event to load the next one

Expected behavior
CrossMTAdmob.Current.ShowInterstitial(); shows the loaded interstitial
CrossMTAdmob.Current.ShowRewardedVideo(); shoes the loaded rewarded video

Actual behaviour
It seems like the plugin might show the last loaded content on either of these calls.

Workaround
Only load the next item to be called

Lightweight SDK not workin on huawei

Hi,

on huawei device (without play services) ads are not show...

I think reason is lite sdk that work only with play services...

any solution?

IAB TCF v2.0 errors detected

Is your feature request related to a problem? Please describe.
Seeing this at the top of our AdMob account.

IAB TCF v2.0 errors detected. We've detected an issue on your IAB TC string on one or more of your sites or apps. These errors may affect your ability to serve ads to European users. A detailed report is available for you on the EU user consent page.

We have Funding Choice installed and apparently the settings are picked up automatically. Can anyone confirm that this is indeed the case with this plugin?

Describe the solution you'd like
I would like this plugin to send the gdpr and TC_string if necessary. However, it might already do so or might not be necessary at all.

From google:

IMA SDK and Mobile Ads SDK will automatically obtain, parse, and respect the TC string from within local storage. For other tag types you will need to pass the following signals manually: gdpr={0,1} and gdpr_consent={tc string}.

Describe alternatives you've considered
I've considered forking the project and adding some code to manually at the values at request time, but according to my reading they should be already picked up

Additional context
N/a

Adjust the control height according to the size of the Ads

Is your feature request related to a problem? Please describe.
Now require to fix the height request of the control in order to show the Ads. Unable to adjust the height of the control based on the size of the Ads. I have configure the height of the control is 90, and if the ads only 50, it will show a gap on the screen.

Describe the solution you'd like
Able to detect the Ads height and the height of the control will be adjusted.

MobileAds.SharedInstance is null in iOS 14.0

Describe the bug
MobileAds.SharedInstance is null in iOS 14.0

Screenshots
Bug

Smartphone (please complete the following information):

  • Device: iPhone SE 1st-gen
  • OS: 14.0

Additional context
Fails on start with null ref exception
MarcTron.Admob version 1.6.0

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.