prebid-mobile-android icon indicating copy to clipboard operation
prebid-mobile-android copied to clipboard

JSbridge to forward MRAID and other events to the native code

Open codofags opened this issue 8 months ago • 2 comments

Prebid Mobile SDK v3.0.0 in an Android app and rendering banners through BannerView. I'm trying to intercept or at least log specific MRAID actions, such as:

mraid.expand()

mraid.close()

mraid.open(url)

While BannerViewListener gives general callbacks like onAdDisplayed() or onAdClosed(), it doesn't provide access to specific MRAID commands triggered by the creative.

Questions: Is there any supported way to intercept or observe MRAID method calls directly within the app layer?

Is there access to the underlying WebView or JS bridge used by BannerView?

If this is not currently possible, is such support planned in future releases?

My use case is to log and debug MRAID behavior for creatives sent from a custom ad server.

Thanks in advance for your guidance and for the great SDK!

codofags avatar Apr 21 '25 07:04 codofags

@ValentinPostindustria could you suggest here? Does SDK have MRAID-related logs?

If no, I'll add this ticket to the backlog in order to implement such logs.

YuriyVelichkoPI avatar Aug 18 '25 12:08 YuriyVelichkoPI

Hello. We don't have such listener. But you can look at tag PrebidJsExecutor.

                       D  evaluateJavaScript: mraid.onViewableChange(true);
                       D  evaluateJavaScript: mraid.setScreenSize(360, 640);
                       D  evaluateJavaScript: mraid.setMaxSize(360, 616);
                       D  evaluateJavaScript: mraid.setCurrentPosition(0, 0, 360, 640);
                       D  evaluateJavaScript: mraid.setDefaultPosition(0, 0, 360, 640);
                       D  evaluateJavaScript: mraid.onSizeChange(1080, 1920);

ValentinPostindustria avatar Aug 19 '25 07:08 ValentinPostindustria