marcojak / MTAdmob

Admob plugin for Xamarin Android and iOS
https://www.xamarinexpert.it/admob-made-easy/
160 stars 26 forks source link

To get ads on test device #116

Closed ablohme86 closed 1 year ago

ablohme86 commented 1 year ago

Hello, I am not getting any ads on my simulator, but I get this message in the debugger:

Google> To get test ads on this device, set: Objective-C GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ GADSimulatorID ]; Swift GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ GADSimulatorID ]

How do I add that in Xamarin?

marcojak commented 1 year ago

You need to add: CrossMTAdmob.Current.TestDevices = new List() { "YOUR DEVICE ID"}

If you look at the source code, there is a sample project that shows clearly how to use this plugin.

marcojak commented 1 year ago

TestDevices= new List...

You are adding strings without initialising the list!

On Tue, 1 Nov 2022, 22:17 Alexander Blohme, @.***> wrote:

I know, but when I try to add: CrossMTAdmob.Current.TestDevices.Add("74cf080f8ed2859a3124e22100f82ed6");

but it gives me an exception: [image: Screenshot 2022-11-01 at 23 17 19] https://user-images.githubusercontent.com/17109732/199352498-0f6a7490-1ee0-4742-8b20-716d1a370447.png

[image: Screenshot 2022-11-01 at 23 16 06] https://user-images.githubusercontent.com/17109732/199352514-f72aff5f-3b7f-4356-b023-8e65018491e3.png

— Reply to this email directly, view it on GitHub https://github.com/marcojak/MTAdmob/issues/116#issuecomment-1299300117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUIPIUH644JU3D5P2D7YDDWGGJIXANCNFSM6AAAAAARUPDIQU . You are receiving this because you commented.Message ID: @.***>