Search in sources :

Example 1 with JsExecutor

use of org.prebid.mobile.rendering.views.webview.mraid.JsExecutor in project prebid-mobile-android by prebid.

the class WebViewInterstitial method setMRAIDInterface.

public void setMRAIDInterface() {
    BaseJSInterface mraid = new InterstitialJSInterface(getContext(), this, new JsExecutor(this, new Handler(Looper.getMainLooper()), new HandlerQueueManager()));
    addJavascriptInterface(mraid, "jsBridge");
    LogUtil.debug(TAG, "JS bridge initialized");
    setBaseJSInterface(mraid);
}
Also used : BaseJSInterface(org.prebid.mobile.rendering.views.webview.mraid.BaseJSInterface) InterstitialJSInterface(org.prebid.mobile.rendering.views.webview.mraid.InterstitialJSInterface) JsExecutor(org.prebid.mobile.rendering.views.webview.mraid.JsExecutor) Handler(android.os.Handler) HandlerQueueManager(org.prebid.mobile.rendering.utils.helpers.HandlerQueueManager)

Example 2 with JsExecutor

use of org.prebid.mobile.rendering.views.webview.mraid.JsExecutor in project prebid-mobile-android by prebid.

the class WebViewBanner method setMRAIDInterface.

public void setMRAIDInterface() {
    BaseJSInterface mraid = new BannerJSInterface(getContext(), this, new JsExecutor(this, new Handler(Looper.getMainLooper()), new HandlerQueueManager()));
    addJavascriptInterface(mraid, "jsBridge");
    LogUtil.debug(TAG, "JS bridge initialized");
    setBaseJSInterface(mraid);
}
Also used : BaseJSInterface(org.prebid.mobile.rendering.views.webview.mraid.BaseJSInterface) BannerJSInterface(org.prebid.mobile.rendering.views.webview.mraid.BannerJSInterface) JsExecutor(org.prebid.mobile.rendering.views.webview.mraid.JsExecutor) Handler(android.os.Handler) HandlerQueueManager(org.prebid.mobile.rendering.utils.helpers.HandlerQueueManager)

Example 3 with JsExecutor

use of org.prebid.mobile.rendering.views.webview.mraid.JsExecutor in project prebid-mobile-android by prebid.

the class MraidEventHandlerNotifierRunnable method run.

@Override
public void run() {
    HTMLCreative htmlCreative = mWeakHtmlCreative.get();
    WebViewBase webViewBase = mWeakWebViewBase.get();
    if (htmlCreative == null || webViewBase == null) {
        LogUtil.debug(TAG, "Unable to pass event to handler. HtmlCreative or webviewBase is null");
        return;
    }
    htmlCreative.handleMRAIDEventsInCreative(mMraidEvent, webViewBase);
    final JsExecutor jsExecutor = mWeakJsExecutor.get();
    if (jsExecutor == null) {
        LogUtil.debug(TAG, "Unable to executeNativeCallComplete(). JsExecutor is null.");
        return;
    }
    jsExecutor.executeNativeCallComplete();
}
Also used : WebViewBase(org.prebid.mobile.rendering.views.webview.WebViewBase) JsExecutor(org.prebid.mobile.rendering.views.webview.mraid.JsExecutor) HTMLCreative(org.prebid.mobile.rendering.models.HTMLCreative)

Aggregations

JsExecutor (org.prebid.mobile.rendering.views.webview.mraid.JsExecutor)3 Handler (android.os.Handler)2 HandlerQueueManager (org.prebid.mobile.rendering.utils.helpers.HandlerQueueManager)2 BaseJSInterface (org.prebid.mobile.rendering.views.webview.mraid.BaseJSInterface)2 HTMLCreative (org.prebid.mobile.rendering.models.HTMLCreative)1 WebViewBase (org.prebid.mobile.rendering.views.webview.WebViewBase)1 BannerJSInterface (org.prebid.mobile.rendering.views.webview.mraid.BannerJSInterface)1 InterstitialJSInterface (org.prebid.mobile.rendering.views.webview.mraid.InterstitialJSInterface)1