B4A Library FirebaseAdmobPlus

ArminKh1993

Active Member
HI ArminKh1993 🌹
Thank you for a good library🙏

There is a small bug in the "IsLoaded" control time
Returns the value "null" but the default should be "false"

Please test the following codes

B4X:
 InterstitialAd.Initialize("InterstitialAd")

    Log(InterstitialAd.IsLoaded)

    If InterstitialAd.IsLoaded = True Then

        Log("InterstitialAd  Is Loaded and go to show ad")

    Else

        InterstitialAd.LoadAdWithBuilder(xxx,builder)

    End If

B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.ads.InterstitialAd.isLoaded()' on a null object reference
I checked and this is being returned by Google SDK itself.
In any case, if the onAdLoaded event raised, it means that the ad is loaded and you do not need to check again.
But, I will try to resolve this issue manually with the new Google update that will be released soon.
 

SMOOTSARA

Active Member
Licensed User
Hi ArminKh1993 🌹

I installed your sample
But I have the following error in the "AppOpenAds" section


B4X:
** Activity (main) Pause, UserClosed = false **
** Activity (actappopenads) Create, isFirst = true **
** Activity (actappopenads) Resume **
AppOpenAds_onAppOpenAdLoaded
java.lang.NoSuchMethodError: No virtual method show(Landroid/app/Activity;Lcom/google/android/gms/ads/FullScreenContentCallback;)V in class Lcom/google/android/gms/ads/appopen/AppOpenAd; or its super classes (declaration of 'com.google.android.gms.ads.appopen.AppOpenAd' appears in /data/app/b4a.remote.config-1/base.apk)
    at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117)
    at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA$2.run(BA.java:387)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6138)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
** Activity (actappopenads) Pause, UserClosed = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
And i update

2. Android SDK + Required Resources

in
https://www.b4x.com/b4a.html

1613331170433.png


1613331203960.png
 

mcqueccu

Well-Known Member
Licensed User
Hi ArminKh1993 🌹

I installed your sample
But I have the following error in the "AppOpenAds" section


B4X:
** Activity (main) Pause, UserClosed = false **
** Activity (actappopenads) Create, isFirst = true **
** Activity (actappopenads) Resume **
AppOpenAds_onAppOpenAdLoaded
java.lang.NoSuchMethodError: No virtual method show(Landroid/app/Activity;Lcom/google/android/gms/ads/FullScreenContentCallback;)V in class Lcom/google/android/gms/ads/appopen/AppOpenAd; or its super classes (declaration of 'com.google.android.gms.ads.appopen.AppOpenAd' appears in /data/app/b4a.remote.config-1/base.apk)
    at com.b4a.admobwrapper.AppOpenAdsWrapper.Show(AppOpenAdsWrapper.java:117)
    at b4a.remote.config.actappopenads._appopenads_onappopenadloaded(actappopenads.java:474)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA$2.run(BA.java:387)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6138)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
** Activity (actappopenads) Pause, UserClosed = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
And i update

2. Android SDK + Required Resources

in
https://www.b4x.com/b4a.html

View attachment 108003

View attachment 108004
Check post number 11. https://www.b4x.com/android/forum/threads/firebaseadmobplus.126078/post-789111

You need to update the admob sdk to 19.6.0 through the sdkmanager
 

mcqueccu

Well-Known Member
Licensed User
You need to download everything new.
Sdk manager at instructions 2
 

asales

Well-Known Member
Licensed User
This library will be updated as soon as Google launches the new Google Mobile Ads SDK for Android version 20.0.0 In early 2021. So several APIs currently available will be changed or retired. See this https://developers.google.com/admob/android/migration
When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name.
I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd.
Thanks.
 

ArminKh1993

Active Member
When you updated this lib, please, rename the Adview (banner) component to AdviewPlus or other name.
I use the Adview banner from the original Admob lib from Erel and I get a conflict with this lib when I try to use the AppOpenAd.
Thanks.
Open xml file of library and rename ìt by yourself
 
Top