Android Question Retrieving user consent correctly

_marek

Member
Licensed User
Longtime User
Hi guys. I am implementing rewarded video ads (using lib FirebaseAdMob (Version 1.52)). My code is based on tutorials:
FirebaseAdMob - Rewarded video ads
https://www.b4x.com/android/forum/threads/firebaseadmob-rewarded-video-ads.71430/#content

FirebaseAdMob and User Consent
https://www.b4x.com/android/forum/threads/firebaseadmob-and-user-consent.93347/#content

Noob question: How is user consent retrieved? Does the app (a) need to be connected to internet or (b) it is retrieved locally from device? If (a) do I need to check periodically connection to internet and update user consent when going online?

Thanks, Marek
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is retrieved from Google servers over the internet.

Remember that you cannot show ads until the device is connected to the internet.

You can change the code to something like:
B4X:
Do While True
consent.RequestInfoUpdate(Array("pub-xxxx"))
   Wait For consent_InfoUpdated (Success As Boolean)
   If Success = False Then
       Log($"Error getting consent state: ${LastException}"$)
       Sleep(10000) '<-- try again in 10 seconds
  Else 
      Exit
   End If
Loop
Log($"Consent state: ${consent.ConsentState}"$)
Do While IsPaused(Main)
       Sleep(100)
   Loop
   CallSubDelayed(Main, "ConsentStateAvailable")
 
Upvote 0

_marek

Member
Licensed User
Longtime User
Erel: Thanks for explanation, will use this code.
kisoft: Yeah, I know, but I don`t know If I can us it differently. What comes in my mind, is to throw in my own consent form, get consent from user regardless of internet connection without using
B4X:
consent.RequestInfoUpdate(Array("pub-xxxx"))
just by remembering and storing users choice for my particular app). But I am almost sure I cannot do it this way, bc like Erel said - consent is (and must be(?)) retrieved from Google servers.
Other than that, I am not sure what benefits showing my own consent form offers. (Leaving out using mediation and more than 12 technology providers...)

Btw, is this still a thing? Because following tip about max 12 providers in order to use google consent form (mentioned in Erels tutorial) is no longer there when selecting ad technology providers in AdMob console:
upload_2019-4-1_7-1-15.png
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Btw, is this still a thing? Because following tip about max 12 providers in order to use google consent form (mentioned in Erels tutorial) is no longer there when selecting ad technology providers in AdMob console:
The latest version of the consent SDK, which is included in the updated FirebaseAdMob library no longer restricts the number of provider.. This was updated yesterday. You need to try it.
 
Upvote 0

_marek

Member
Licensed User
Longtime User
I don`t mean consent form itself, but consent (personalized or non personalized ads) must be(?) retrieved from google servers.
 
Upvote 0
Top