Italian AdMob problemi con il codice

SSDM71

Active Member
Licensed User
Longtime User
Ho messo nel mio programma il seguente codice per far apparire il banner
B4X:
Banner_Sotto_Audio.Initialize2("Ad","ca-app-pub-9860102643964774/2601596448",Banner_Sotto_Audio.SIZE_SMART_BANNER)
            Dim height As Int
            If GetDeviceLayoutValues.ApproximateScreenSize<6 Then
                'Telefoni
                height=50dip
            Else
                'Tablet
                height = 90dip
            End If
            Activity.AddView(Banner_Sotto_Audio,0dip,100%y-height,100%x,height)
            Banner_Sotto_Audio.LoadAd
            Banner_Sotto_Audio.BringToFront

Avvio in modalità release però del banner neanche l'ombra. Cosa mi sono dimenticato?

Grazie,
 
D

Deleted member 103

Guest
Prova a fare così.
B4X:
Banner_Sotto_Audio.Initialize2("Ad","ca-app-pub-9860102643964774/2601596448",Banner_Sotto_Audio.SIZE_SMART_BANNER)
Activity.AddView(Banner_Sotto_Audio, 0dip, 100%y - GetAddViewHeight , 100%x, GetAddViewHeight )
Banner_Sotto_Audio.LoadAd
Banner_Sotto_Audio.Visible=True

Sub GetAddViewHeight As Int
   Dim height As Int
   If GetDeviceLayoutValues.ApproximateScreenSize < 6 Then
    'phones
    If 100%x > 100%y Then height = 32dip Else height = 50dip
   Else
     If 100%y>100%x Then
       'tablets
       height = 90dip
    Else
       height = 50dip
    End If
   End If
   Return height
End Sub


Sub Ad_FailedToReceiveAd (ErrorCode As String)
    Log(ErrorCode)
End Sub
Sub Ad_ReceiveAd
    Log("Ad_ReceiveAd")
End Sub
 
Last edited by a moderator:

SSDM71

Active Member
Licensed User
Longtime User
Vedo che hai usato Banner_Sotto_Audio e AdView1 quindi vuol dire che:
Dim AdView1 As AdView
Dim Banner_Sotto_Audio As (?)

Cos'è Banner_Sotto_Audio? O è solo una dimenticanza e sostituisco AdView1 e metto Banner_Sotto_Audio?
 
D

Deleted member 103

Guest
Corretto!
Scusa era solo una dimenticanza.
 

SSDM71

Active Member
Licensed User
Longtime User
Non funziona lo stesso , grazie ma non può essere che funziona solo quando pubblicata?
 
D

Deleted member 103

Guest
Non c'è bisogno che sia publicata.
Puoi postare una parte del progetto?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…