Function mraid.getScreenSize() reports wrong values in Android Interstitial ads

153 views
Skip to first unread message

Gregor Cepin

unread,
May 27, 2019, 7:50:26 AM5/27/19
to Google Mobile Ads SDK Developers
Hi,

using the bellow snippet I was able to reproduce a behaviour that appears to be a bug. If an Interstitial ad is shown when the device is in landscape mode, width and height values received from mraid.getScreenSize() are incorrect (width and height values appear to be switched), and keep being incorrect after further device orientation changes. If an ad is shown when the device is in portrait mode, it works as expected.

<div id="text" style="width: 300px; height:300px; background-color: yellow;"></div>
<script src='mraid.js'></script>
<script>
    setInterval
(function(){
       
var screenSize = mraid.getScreenSize();
        document
.getElementById('text').innerText = 'Width: ' + screenSize.width + ', height: ' + screenSize.height + ', time: ' + Date.now();
   
}, 1000);
</script>


Issue happens in Interstitial ads on Android.
window.MRAID_ENV content is {"version":"3.0","sdk":"Google Mobile Ads","sdkVersion":"17.1.22-000"}

I was able to reproduce the issue on: 
  • Samsung Galaxy S5, Android 6.0
  • Nexus 5, Android 6.0
  • Samsung Galaxy S9, Android 8.0
  • Pixel 2, Android 8.1

Attached are screenshots in landscape and portrait mode.

Thanks,
Gregor
Screenshot_20190524-151538.png
Screenshot_20190524-151534.png

Mobile Ads SDK Forum Advisor Prod

unread,
May 27, 2019, 10:51:25 PM5/27/19
to google-adm...@googlegroups.com
Hi there,

Thank you for reporting this.

Were you able to reproduce the issue using our sample app? If so, please provide it to us the via Reply privately to author option so we could have a closer look.

Regards,
Teejay Pimentel
Mobile Ads SDK Team

ref:_00D1U1174p._5001UAqjhj:ref

Gregor Cepin

unread,
Jun 6, 2019, 11:04:18 AM6/6/19
to Google Mobile Ads SDK Developers
Hi team,

is there any info about this issue from your side? 

I have sent you a private reply last week as instructed, but didn't get any response. As I mentioned there, I was able to reproduce it in Interstitial sample app 5.6 with the above simple code and with an actual ad as well. Only requirement is to have the device in landscape orientation at the time the ad is shown. Many mobile games are played in landscape mode, therefore issue occurs a lot. 

Best regards,
Gregor

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 6, 2019, 10:14:30 PM6/6/19
to gregor...@celtra.com, google-adm...@googlegroups.com
Hi, 

Apologies for the back and forth. Could you upload the project file in to your Google drive and provide to us the shareable link instead?

Gregor Cepin

unread,
Jul 12, 2019, 9:49:21 AM7/12/19
to Google Mobile Ads SDK Developers
Hi,
link to the Apk of the sample app where issue can be seen: https://drive.google.com/file/d/10-lT6SpWaVD_UK_QyHexFUSsC-Jj8X--/view?usp=sharing
Anyway, it is just a sample interstitial app with the above mentioned ad code. Only requirement to see the issue is to have the device in landscape orientation in the beginning, when ad is to be shown.

Thanks 

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 15, 2019, 1:35:33 AM7/15/19
to google-adm...@googlegroups.com
Hi,

I received the project file that you provided and was able to reproduce the issue on my end. With that said, I'll raise this to our Engineering team for further checking and get back to you with their feedback.

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 16, 2019, 10:20:43 PM7/16/19
to google-adm...@googlegroups.com
Hi,

Hope you are doing well.

Could you provide us the Charles logs (here are setup instructions) captured when you encounter the behavior?

Gregor Cepin

unread,
Jul 17, 2019, 6:03:01 AM7/17/19
to Google Mobile Ads SDK Developers

Mobile Ads SDK Forum Advisor Prod

unread,
Jul 17, 2019, 6:47:00 AM7/17/19
to google-adm...@googlegroups.com
Hi,

Thank you for providing the Charles log. I already sent the file to our Engineering team. I'll let you know how the investigation goes and update this thread for any feedback available.

Gregor Cepin

unread,
Aug 21, 2019, 7:25:05 AM8/21/19
to Google Mobile Ads SDK Developers
Hi team,
any update about this?

Thanks

Mobile Ads SDK Forum Advisor Prod

unread,
Aug 22, 2019, 1:42:46 AM8/22/19
to google-adm...@googlegroups.com
Hi there,

I'm afraid the issue is still under investigation. I'll make a follow up on our Engineering team and update this thread for any feedback available.
Reply all
Reply to author
Forward
0 new messages