I am trying to add adv. through Admob in my project in B4A 10.2. I have referenced Firebase Admob library, added google-services.jason file in folder and added below lines in manifest.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
Just to check i added below code in Activity_Create
'Admob
BannerAd.Initialize2("BannerAd", "ca-app-pub-3940256099942544/6300978111", BannerAd.SIZE_SMART_BANNER)
Dim height As Int
If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
'phones
If 100%x > 100%y Then height = 32dip Else height = 50dip
Else
'tablets
height = 90dip
End If
Activity.AddView(BannerAd, 0dip, 100%y - height, 100%x, height)
BannerAd.LoadAd
IAd.Initialize("iad", "ca-app-pub-3940256099942544/1033173712")
IAd.LoadAd
I have added my project in Firebase.
When i run the project it crashes in mobile.
I think i am missing something.
Can someone pls give some clue.
Thanks
Juzer