User Messaging Platform (UMP) SDK related question

213 views
Skip to first unread message

elix22

unread,
Jul 15, 2022, 12:28:39 PM7/15/22
to Google Mobile Ads SDK Developers
Hi 
I followed the quick start located in :

Everything works fine  , the form is presented as expected .

In my game logic I need to have some indication once the form is closed (regardless if consent is given or not) in order to transition to the next state in the game .

Such indication was given in the legacy SDK ,  but I didn't find it in the new one.
I think such indication is a must (unless I am missing something) .
Any solution would be appreciated.


Thanks

Mobile Ads SDK Forum Advisor

unread,
Jul 15, 2022, 4:27:35 PM7/15/22
to alon...@gmail.com, google-adm...@googlegroups.com
Hi there,

The UMP SDK takes up the main thread, is there something you show right after a call to UMP?  Could you set up your use case in a sample app (Android , iOS ) with slight modification and send it privately to us with replication of scenario steps?

Regards,

Google Logo
Aryeh
Mobile Ads SDK Team
 

 

ref:_00D1U1174p._5004Q2cWYat:ref

elix22

unread,
Jul 16, 2022, 12:44:16 AM7/16/22
to Google Mobile Ads SDK Developers
Hi thanks for the quick reply.
Attaching the Java side of the code , I don't mind to share it publicly .

I am using my own customized .NET 6 game engine with C# <-> Java Interoperability .
All The game logic resides on the C# (.NET) side .
The Java is only in charge  of the Consent from logic

1 - C# side calls a JNI function (line 50 , CreateUserConsent() ) 
2 - The Java side invokes the right logic presenting the form (so yes the form is presented in the beginning of the game)
3 - Once the form is closed (regardless of consent or not) , the java side should call a callback(delegate) on the C# side. ( Line 27 , OnUserConsentStatus(int i))

Step 3 can't be implemented since there is no such indication  for closing the form (I didn't find any) .

So far I did some workaround/hack (I don't like it but couldn't find anything better)   , after step 2   I am checking the Consent Status every 1 second . (calling  from C#  the JNI function  , line 39 GetConsentStatus())
If it's not equal to 2 (ConsentInformation.ConsentStatus.REQUIRED )  then I transition to the next state in the game.
 


UserConsent.java

Mobile Ads SDK Forum Advisor

unread,
Jul 18, 2022, 3:05:00 AM7/18/22
to alon...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for your response.

With regard to your concern for getting the indication once the form is closed, I think you can try to achieve this inside the "requestConsentInfoUpdate". Then call your implementation for the next state inside the "onConsentInfoUpdateSuccess" for "ConsentStatus" to get the consent given or not. Let me know how it goes.

Regards,

Google Logo
Princess Pamela
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2cWYat:ref

elix22

unread,
Jul 19, 2022, 8:55:49 AM7/19/22
to Google Mobile Ads SDK Developers
Hi ,
onConsentInfoUpdateSuccess is called only once with consentStatus equal to ConsentInformation.ConsentStatus.REQUIRED (so the form is presented to the user)
Once the form is  closed , onConsentInfoUpdateSuccess is not called  again, so there is nothing indicating that the form was closed.
The form close indication was available in the legacy SDK ,  I am really surprised that no one raised that issue so far.

Consider the following use case with several  sequential states.
1 - User is presented with the consent form (ConsentInformation.ConsentStatus.REQUIRED)
2 - User is presented with another customized UI dialog (The UI is created via my game engine , OpenGLES backend, it's not a native Android UI) requesting additional game related input (i.e. entering  new user name)
3 - Game Menu UI is presented (also  game engine UI  , OpenGLES backend) .

It's impossible to go to state #2 (and #3 afterwards)  till the consent form is closed with indication that the form was closed.


B.R.

Mobile Ads SDK Forum Advisor

unread,
Jul 19, 2022, 3:59:47 PM7/19/22
to alon...@gmail.com, google-adm...@googlegroups.com
Hi,

Thank you for getting back with your use case. Would adding an Android Native on main thread function right after the consent screen that lasts for a microsecond that would give a signal help? As soon as the consent screen is gone this would load. Feel free to get back if this isn't feasible.

Regards,

Google Logo
Aryeh
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2cWYat:ref

Eli Aloni

unread,
Jul 20, 2022, 8:53:49 AM7/20/22
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Hi ,
That might work but I consider it to be a workaround and not a valid solution .
To remind you that I do have my own workaround that actually works (checking the status every 500-1000 milliseconds )
Bottom line , currently there is no such indication  ,it's definitely a design flaw  (it was available in the past legacy SDK).
My humble suggestion is to add it in the coming releases (although I am aware  of the inner workings in big software  companies :) )

Thanks
Eli

Mobile Ads SDK Forum Advisor

unread,
Jul 20, 2022, 1:05:02 PM7/20/22
to alon...@gmail.com, google-adm...@googlegroups.com
Hi Eli,

Thank you for getting back to us. I raised with my team your request for an indicator that the UMP SDK finished. This request is subject to review. You may monitor our blog for an update.

Eli Aloni

unread,
Jul 21, 2022, 3:25:44 AM7/21/22
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Hi Aryeh,
Thanks for handling this issue.

B.R.
Eli

Mobile Ads SDK Forum Advisor

unread,
Jul 21, 2022, 3:09:45 PM7/21/22
to alon...@gmail.com, google-adm...@googlegroups.com
Hi Eli,

My team came back with this:

You may use the `OnConsentFormDismissedListener` to be notified when the user makes a decision, found here:https://developers.google.com/admob/ump/android/api/reference/com/google/android/ump/ConsentForm.OnConsentFormDismissedListener

We'll be updating the docs to include this information as well.

Eli Aloni

unread,
Jul 21, 2022, 3:59:26 PM7/21/22
to Mobile Ads SDK Forum Advisor, google-adm...@googlegroups.com
Hi ,
I actually already tried it before , also tried it now several times  just to be sure .
It's not getting called once the form is closed  ( onConsentFormDismissed ).
From all my attempts (at least 10)  I saw it only once getting called with some error .
Thanks
Eli

Mobile Ads SDK Forum Advisor

unread,
Jul 22, 2022, 1:40:12 AM7/22/22
to alon...@gmail.com, google-adm...@googlegroups.com
Hi Eli,

Thank you for sharing your feedback. Would it be possible for you to provide a test project reproducing the reported behavior? Kindly send it via Reply Privately to Author option. 
 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002cWYatQAG&entry.80707362=00114318

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Regards,

Google Logo
Teejay Wennie
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2cWYat:ref
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages