Android Question invalid ad request in admob google

azad222

Member
I have the following code
b4a code:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim AdView1 As AdView

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    
    AdView1.Initialize2("ad", "ca-app-pub-3940256099942544/6300978111", AdView1.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(AdView1, 0dip, 100%y - height, 100%x, height)
    AdView1.LoadAd

End Sub

Sub Ad_FailedToReceiveAd (ErrorCode As String)
    Msgbox(ErrorCode , "khata")
End Sub
Sub Ad_ReceiveAd
    Msgbox("daryaft shod" , "ok")
End Sub
Sub Ad_AdScreenDismissed
    Msgbox("safhe rad shod", "natije")
    
End Sub
add to manifest:

manifest:
'AdMob
AddApplicationText(
<activity android:name="com.google.ads.AdActivity"
  android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'End of AdMob
But when running, it gives the following error:
invalid ad request

I use Library adMob v1.40
 
Top