Android Question Firebase Admob did not appear in the app !

Alansari

Member
Licensed User
Longtime User
Hi
Firebase Admob did not appear in the app
I linked with Firebase site
and i put the file : "google-services.json" in project folder

firebase_error-png.59781



firebase_error2-png.59782
 

Attachments

  • Firebase_error.png
    Firebase_error.png
    74.2 KB · Views: 549
  • Firebase_error2.png
    Firebase_error2.png
    59.3 KB · Views: 488

Alansari

Member
Licensed User
Longtime User
1. You should post the code and logs as text instead of screenshots (right click on the logs to copy).
2. There is no need to add an exclamation mark to the title. Why shout on other members who want to help you???

Ok . but with photos explained :D

What is the solution about my problem ?
 
Upvote 0

eps

Expert
Licensed User
Longtime User
I think it's this format.. well it is in mine.

ca-app-pub-1234567890123456/9876543210

so hyphens and then forward slash at the end.

HTH
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Hmm...

Just try one - either the IAD or the BannerAd - narrow down the chances of an error occurring in the first place. Banners work well - I'm not sure about Interstitials.

I think there was an 'issue' but think it's been resolved now.
 
Upvote 0

Alansari

Member
Licensed User
Longtime User
Hmm...

Just try one - either the IAD or the BannerAd - narrow down the chances of an error occurring in the first place. Banners work well - I'm not sure about Interstitials.

I think there was an 'issue' but think it's been resolved now.

Ok . I will try
 
Upvote 0

Alansari

Member
Licensed User
Longtime User
Ok . I will try

no done . the app stoped

Please , modify the code
B4X:
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("a_main")
    
    BannerAd.Initialize2("BannerAd", "9767348470953371~7092659951", 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-9767348470953371/5785594946")
    IAd.LoadAd
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Those aren't your actual publisher ids are they? Remove or change if they are! Just to make sure.

I can't speak for the Interstitials but the BannerAd should definitely work.

I use the following

B4X:
    'Admob - Firebase

    AdView1.Initialize2("AdView1", "ca-app-pub-REMOVED/1234567890", AdView1.SIZE_SMART_BANNER) 'publisher id that you received from AdMob.

    Dim ScreenHeight, pScreenWidth, AdLeftHandSide As Int

    ScreenHeight = Activity.Height - 50dip


    pScreenWidth=GetDeviceLayoutValues.Width


        AdLeftHandSide = 0dip

    Activity.AddView(AdView1, AdLeftHandSide, ScreenHeight, pScreenWidth, 50dip) 'previously the height was 48dip. Now it is 50dip.

    AdView1.LoadAd 'loads an ad

This works for me.. Please comment out your code and try the above - with the same publisher id format and see.

I guess you've got a couple of Ad modules defined as well - ad_received and ad_failedtoreceive?
 
Upvote 0

Alansari

Member
Licensed User
Longtime User
Those aren't your actual publisher ids are they? Remove or change if they are! Just to make sure.

I can't speak for the Interstitials but the BannerAd should definitely work.

I use the following

B4X:
    'Admob - Firebase

    AdView1.Initialize2("AdView1", "ca-app-pub-REMOVED/1234567890", AdView1.SIZE_SMART_BANNER) 'publisher id that you received from AdMob.

    Dim ScreenHeight, pScreenWidth, AdLeftHandSide As Int

    ScreenHeight = Activity.Height - 50dip


    pScreenWidth=GetDeviceLayoutValues.Width


        AdLeftHandSide = 0dip

    Activity.AddView(AdView1, AdLeftHandSide, ScreenHeight, pScreenWidth, 50dip) 'previously the height was 48dip. Now it is 50dip.

    AdView1.LoadAd 'loads an ad

This works for me.. Please comment out your code and try the above - with the same publisher id format and see.

I guess you've got a couple of Ad modules defined as well - ad_received and ad_failedtoreceive?

not work

I will use old code of admob and i see
 
Upvote 0

Alansari

Member
Licensed User
Longtime User
WAAAAAAAAW now working :p

I used Old AdMob code :
B4X:
AdView1.Initialize("Ad", "ca-app-pub-9767348470953371/5785594946")
    Activity.AddView(AdView1, 0dip, 100%y-50dip, 100%x, 50dip)
    AdView1.LoadAd

I thank all who helped me :D
 
Upvote 0
Top