Bug:UnifiedNativeAd starRating can be 0.0, even though it's not supposed to be this way

83 views
Skip to first unread message

AD_LB

unread,
Aug 4, 2020, 7:30:53 AM8/4/20
to google-adm...@googlegroups.com
I printed the value of nativeAd.starRating?.toFloat() , and it was 0.0.
When non-null, I assume the rating is available. The docs say that when it's 0..5 , it's the rating that I should use:

For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it. Apps are not required to display this asset, though it's recommended.


Clicking the ad, it goes to this app:

And it has a non-0 rating...

Please fix this.
2020-08-04_14-30-19.png
2020-08-04_14-29-58.png

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 4, 2020, 10:06:51 AM8/4/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi AB_LB,

Thank you for bringing this question to our attention.

Based on the information that you have given us, it would look to be that while unusual, the 0 for the star rating could be correct. As it states that the developer does not have to give out access to the star rating. It is recommended that they do, but in no way must they. As such, it would make sense that the rating is set to 0 by the system so as to avoid Null in the response.

Regards,
William Pescherine
Mobile Ads SDK Team

ref:_00D1U1174p._5004Q23HPjs:ref

AD_LB

unread,
Aug 4, 2020, 10:20:17 AM8/4/20
to Google Mobile Ads SDK Developers
That's incorrect.
The type of the variable is nullable (Double on Java).
The valid rating values are between 0 to 5, when it's available.
When there is no rating specified, it's null. I've already noticed it being null on various cases, when it's not an ad of an app.
What I report here is that sometimes, when it's not null (meaning it's available), it can have the wrong value (0 in this case).

Please fix this issue.

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 4, 2020, 2:51:23 PM8/4/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi AB_LB,

Thank you for responding back, If you can send us a sample of your app so that we can test it on our end. And get the information that we need. 

And yes while Double can be Nullable, doesn't mean that it is set to null at start. Which even you said, the owner of the app that is being displayed might not have given you the asset for the star rating. Their might be something that is setup with that ad that is sending you back a 0 or that they are just not giving you that asset. There even could be under the hood logic which to avoid the null in this case is setting the starRating = 0.

Once we have the sample. I will look to bring this to our team. To have them look at what you have so that we can better help you with this situation. Or if you would like, you can download our sample app . And add in the modifications that you made to yours and send this to us so that we can look over this to find out the issue is for you.
Message has been deleted

AD_LB

unread,
Aug 5, 2020, 3:27:30 AM8/5/20
to google-adm...@googlegroups.com
What do you think it means for a Double to be null in this case, if it's not documented, and if it specifically says in the docs that 0..5 are the valid values ?
It has to be for this purpose, and indeed it can be null. Check your own sample. It's always null when using test-unit-ID.
If null was not planned to be used for this purpose, the type would have been "double" instead of "Double", and a special value would be used for this purpose.

The sample you have should suffice. Just use ad unit ID (and maybe app ID too) that offers to show star rating.  Might need real ones. 
Since I can't always reproduce it, as you don't offer ad unit IDs that are predictable and they are all random (including of course real ones), you should find one that does have it.

And sadly since test ad unit IDs can fail even loading (and I reported about this), it's even worse to show you on the real app.
So in short, getting a non-null value for starRating is very rare. It would be nice if you could offer easier way to test native ads.
Currently it's random, but it's also very restricted to very specific set of fields that will ever be filled.

For some reason there is no test-unit-ID on the website that has this kind of ads:
https://developers.google.com/admob/android/test-ads

Can you please fix the communication here?
I keep seeing just "ref" instead of the conversation and links to the forum.
There is no context. I can't see what you wrote before, and I can't see what I wrote before.
Each time I get an email, I lose the context. I lose the entire conversation. I need to reach the forum again and find where is what you wrote.

And even when I do write a reply here, I can't attach files to it. I have to first post without files, and then edit it and add them.
NativeAdvancedExample.zip
2020-08-05_10-10-27.png

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 5, 2020, 6:20:55 AM8/5/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi there,

I work along with William. Let me do the best I can to assist you in this.

As per checking, the behavior could be a creative specific. With this, would it be possible for you to provide a Charles log (see instructions here) capturing the behavior? This will greatly help us in our investigate as this will enabling us to test the ad in our test App environment by trafficking the creative in the test network.

Regards,
Teejay Pimentel

AD_LB

unread,
Aug 5, 2020, 6:33:45 AM8/5/20
to Google Mobile Ads SDK Developers
Incorrect. What's the difference between null and 0 , then ? 
And why doesn't the documentation say anything about this?


For ads about apps, returns a star rating from 0 to 5 representing how many stars the app has in the store offering it. Apps are not required to display this asset, though it's recommended.


So, if it's 0,1,2,3,4,5 - this is how many stars the app has on the store.
That's what you have on your documentation.
It doesn't say that 0 is the same as null, that it should mean that there is no rating.
It lists 0 as a valid number, right with the others.

As for logs, please provide an easier alternative. I can't use this tool.

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 5, 2020, 10:20:08 AM8/5/20
to lbl...@gmail.com, google-adm...@googlegroups.com
HI AD_LB,

There are actually massive differences in null and 0. Null is a pointer to a place in memory that has nothing in it. Where as 0 has a pointer to a space in memory that is holding a piece of data which contains a 0. This is very important to understand the difference, when looking at something that references that memory location. If a piece of code goes to that location and finds null and needs to do something based on what is within that location you will get a crash if it is null, NaN(Not a Number). Where as you will get the code properly executing if it is 0. So in general it is a very bad item to declare a variable as a null, int x; if you are doing this you should really set it as int x = 0;  .

As for not in documents. I looked at your original post and in it you mention that it is possible for the asset to not be sent to you. Also if you are asking about why the documents do not talk about null and 0? Here is a link that talks about it. It is generally discussed in most every coding lecture.

And as stated I have also passed all these cases along to our team to have them look at it further.

Regards,
William Pescherine

AD_LB

unread,
Aug 5, 2020, 10:56:04 AM8/5/20
to Google Mobile Ads SDK Developers
No. That's not what I asked. You've lost the context of this thread.
I asked in this context:
What's the difference between 0 and null, when we talk about the rating.
According to what you write, there is no difference, because in both cases it shouldn't be used to be shown to the user. Both are invalid according to what you write.

The link you've provided isn't related to the topic at all.
We talk about rating in native ads.
You need to decide what's considered invalid and what isn't, and write about it on the docs. 
The docs specifically say that 0..5 are valid values, which leaves everything that's outside of the possible values (including null) to be invalid.
This means we are supposed to use 0..5 when we get them.
And, seeing that I can get both 0 and null proves my point.

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 5, 2020, 11:21:59 AM8/5/20
to lbl...@gmail.com, google-adm...@googlegroups.com
Hi AD_LB,

I will be bring this to my team and seeing what extra information they might have regarding this. Once we have more information we will pass it along to you.

AD_LB

unread,
Aug 5, 2020, 11:54:48 AM8/5/20
to Google Mobile Ads SDK Developers
Good. Can you please also tell them about this website?
Instead of links to the forum, all I see if gibberish text on the end, with "ref" 
Reply all
Reply to author
Forward
0 new messages