Android Question Recent wrappers FirebaseCore / FirebaseAdMob2 for B4A 13.40

DOM85

Active Member
Licensed User
Longtime User
Hello,

I have to use Rewarded Ads.
I tried to use different versions of FirebaseAdmob, without success.
FirebaseApp remains unknown.

I already have the additional libraries (additionalLibraries.zip).
But i need the complete pack wrappers FirebaseCore / FirebaseAdMob2 récent pack for B4A 13.40
Does anyone knows where I can download this pack ?
Thank you.
 

asales

Expert
Licensed User
Longtime User
The last version of the FirebaseAdmob2 is working fine. I use it with rewarded ads.

Try to upload a small project that not worked, to understand what you doing and help you.
 
Upvote 0

DOM85

Active Member
Licensed User
Longtime User
The last version of the FirebaseAdmob2 is working fine. I use it with rewarded ads.

Try to upload a small project that not worked, to understand what you doing and help you.
Thank you. Here is my small example app, in B4A V13.40. I am registered on Firebase website, and i received the json file.


#Region Project Attributes
#ApplicationLabel: AdmobRewardedDemo
#VersionCode: 1
#VersionName: 1.0
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#End Region

#AdditionalJar: com.google.android.gms:play-services-ads

Sub Process_Globals
End Sub

Sub Globals
Private AD As RewardedAd ' ****** Unknown ******
Private RewardLoaded As Boolean
Private Firebase As FirebaseApp ' ****** Unknown ******
Private ButtonShow As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.loadlayout("layout.bal")
Firebase.Initialize
AD.Initialize("AD")
LoadAd
End Sub

Sub LoadAd
RewardLoaded = False
AD.LoadAD("ca-app-pub-3940256099942544/5224354917")
End Sub

Sub Ad_AdLoaded
RewardLoaded = True
End Sub

Sub Ad_AdFailedToLoad (ErrorCode As Int)
RewardLoaded = False
End Sub

Sub Ad_Rewarded (RewardType As String, RewardAmount As Float)
End Sub

Sub Ad_AdClosed
LoadAd
End Sub

Sub ButtonShow_Click
If RewardLoaded = True Then
AD.Show
Else
LoadAd
End If
End Sub
[/CODE]
 
Upvote 0

asales

Expert
Licensed User
Longtime User
1 - Post code between code tags - it makes it so much easier to read: Forum Etiquette
2 - You need the AdsHelper class to use RewardedAd (AdsHelper.FetchRewardedVideoAd)
3 - Check if you don't use different libs, like FirebaseAdmobPlus. Use the FirebaseAdmob2 lib.
4 - "FirebaseApp"? Where did you find this information? From other lib? It is not necessary to Admob. You need to initialize the "MobileAds".
5 - My example (that works with Rewarded ad) and my advices is to the original lib from @Erel.
 
Upvote 0
Top