marcojak / mtadmob Goto Github PK
View Code? Open in Web Editor NEWAdmob plugin for Xamarin Android and iOS
Home Page: https://www.xamarinexpert.it/admob-made-easy/
Admob plugin for Xamarin Android and iOS
Home Page: https://www.xamarinexpert.it/admob-made-easy/
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:
Expected behavior
No errors on each platform (Android and iOS)
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:
Expected behavior
Video interstitial is working
Smartphone (please complete the following information):
Just reopening an issue #37
Describe the solution you'd like
Hi,
first thank you for making ad integration so easy with your plugin.
Google is offering a new "User Messaging Platform" SDK to collect consent. Is there a chance to integrate the SDK into this plugin?
Another user made a good post here: xamarin/XamarinComponents#931 (comment)
Documentation
User Messaging Platform (UMP) (Android documentation)
User Messaging Platform (UMP) (IOS documentation)
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:
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):
Smartphone (please complete the following information):
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!
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?
Hello, is there a plan to support new requirements in iOS 14?
https://support.google.com/admob/answer/9997589?hl=en
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):
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:
Expected behavior
Build completes without error.
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.
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.
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 👍
HI Marco,
to show interstitials there are 2 lines of code:
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?
Is that the best way to do it?
please add support for UWP- Apps since MS is shutting down there platform in june.
Kind regards,
Martin
// 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.
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 :
My Nugget :
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
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!
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.
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:
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):
Smartphone (please complete the following information):
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" />
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.
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:
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):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
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.
Hi,
Beside SmartBanner, can it support other types of AdSize?
Thanks,
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!
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:
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):
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:
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!
If you create a new project and add this library and set the android options Linking to anything other than None the application will crash when you try to open it.
I read somewhere that this is cause related to AOT? I don't know anything about AOT.
Describe the bug
Banner on android is not displayed on start. Starts working only when interstitial is shown.
To Reproduce
Expected behavior
Banner appeared
Actual behavior
Banner is empty
Smartphone (please complete the following information):
Additional context
After calling interstitial ad, the banner immediately appears, so i do not know, where the problem actually is.
iOS is ok
When using API 30 the Ads is not showing. The Ads show for API 29 below.
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:
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>
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.
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>
<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>
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?
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!
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"
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:
Expected behavior
Video should just load and start playing like under IOS 14
Smartphone (please complete the following information):
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.
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!
Please provide RDP signal for California Consumer Privacy Act compliance according https://developers.google.com/admob/android/ccpa .
What about adding Admediation support to the plug in?
Mediation
AdMob Mediation - Mobile Ads Garage #8
Xamarin.Android.AdColonySdk
Xamarin.Android.GoogleAdsMediation.AdColonyAdapter
Integrating AdColony with Mediation
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");
Describe the bug
When I call CrossMTAdmob.Current.ShowInterstitial(); a RewardedVideo shows
To Reproduce
On App start, I
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
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?
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
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.
I am using MTAdmob for a while and it is really good. However, I find that it is missing Comply with Google Play’s Families Policy using AdMob (https://support.google.com/admob/answer/6223431). Is it possible to include this options as a global options?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.