iOS Question iAdMob interstitial work and Banner no ?

Filippo

Expert
Licensed User
Hi,

as the title suggests.
When Banner comes this error message:
AdView1:Error Domain=com.google.ads Code=1 "Request Error: No ad to show." UserInfo=0x170879a80 {NSLocalizedDescription=Request Error: No ad to show., NSLocalizedFailureReason=Request Error: No ad to show.}
Mein Code:
B4X:
        'AdMob hinzufügen(Werbung)
           AdView1.Initialize("AdView1","ca-app-pub-3476309460992388/1338460354", Page1, AdView1.SIZE_SMART_BANNER_LANDSCAPE)
        Page1.RootPanel.AddView(AdView1, 0, 100%y - GetAddViewHeight, 100%x, GetAddViewHeight)
        AdView1.LoadAd
        AdView1.Visible=True

           iad.Initialize("iad","ca-app-pub-3476309460992388/1338460354")
        iad.RequestAd

Sub GetAddViewHeight As Int
   Dim height As Int
   If GetDeviceLayoutValues.DeviceApproximateScreenSize < 6 Then
     'phones
     If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.height Then
       height = 32dip
     Else
       height = 50dip
     End If
   Else
     If GetDeviceLayoutValues.Width > GetDeviceLayoutValues.height Then
       'tablets
       height = 60dip
     Else
       height = 90dip
     End If
   End If
   Return height
End Sub
 

Filippo

Expert
Licensed User
I think I have found the error.
There must be 2 different Admog-ID, one for "interstitial" and one for "banner"
 

abhishek007p

Active Member
Licensed User
in your code
AdView1.SIZE_SMART_BANNER_LANDSCAPE

you have used SIZE_SMART_BANNER_LANDSCAPE instead of SIZE_SMART_BANNER_PORTRAIT

is it correct, would not that will look big on iPhone in portrait mode?
or i should Initialize the ads based on device's portrait or landscape mode ?
 
Last edited:

Filippo

Expert
Licensed User
Hi abhishek007p,

I use only banners with iAdmob. iAd and "interstitial" I do not use because you have only problems with Apple. :mad:
 
Top