- Joined
- Jan 2, 2020
- Messages
- 1,414
Please can someone guide me how do I get the example to work?
It keep telling me "identifier ShowAd not found."
It keep telling me "identifier ShowAd not found."
Code:
#If TARGET<>"android" And TARGET<>"ios"
#Error "Admob is only supported on Android and iOS targets"
#End
#ADMOB_PUBLISHER_ID="ca-app-pub-3940256099942544/6300978111" 'replace with id from your admob account
#ADMOB_ANDROID_TEST_DEVICE1="TEST_EMULATOR"
#ADMOB_ANDROID_TEST_DEVICE2="TEST_EMULATOR"
Import mojo
Import brl.admob
Class MyApp Extends App
Field admob:Admob
Field interstitialAdmob:AdmobInterstitial
Field layout:=1
Field state:=1
Method OnCreate()
admob=Admob.GetAdmob()
admob.ShowAdView 1,layout
interstitialAdmob=AdmobInterstitial.GetAdmobInterstitial("ca-app-pub-3940256099942544/1033173712")
SetUpdateRate 60
End
Method OnUpdate()
If MouseHit( 0 )
If state = 3
admob.HideAdView
state+=1
Else If state = 1
layout+=1
If layout=7 layout=1
admob.ShowAdView 1,layout
state+=1
Else If state = 2
admob.HideAdView
interstitialAdmob.ShowAd
state+=1
End
End
End
Method OnRender()
Local en:="disabled"
If state=2 en="enabled"
Cls
PushMatrix
Scale 2,2
DrawText "Click to toggle ads! ads are currently "+en,DeviceWidth/4,DeviceHeight/4,.5,.5
PopMatrix
End
End
Function Main()
New MyApp
End