Skip to content

jteamdev/app-demo

Repository files navigation

马甲包推送事件

H5与马甲包的沟通,请马甲包在webview下的window插入对象jsBridge,内容提供回调函数postMessage

webView.addJavascriptInterface(new JsInterface(), "jsBridge");

接收事件

public class JsInterface {
    // Android 调用 Js 方法1 中的返回值
    @JavascriptInterface
    public void postMessage(String name, String data) {
        Log.e(TAG, "name = " + name + "    data = " + data);
        if (TextUtils.isEmpty(name) || TextUtils.isEmpty(data)) {
            return;
        }
        AppsFlyerLibUtil.event(MainActivity.this, name, data);
    }
}

H5回调代码如下 :

window.jsBridge?.postMessage(eventName, params)

传递参数  :

名称 类型 说明
eventName String 页面转换时的浏览纪录:"page_view"
开启页面:"open_page"
关闭页面:"close_page"
点击注册:"click_register"
点击OTP驗證:"click_OTP_verify"
点击银行资讯:"click_binding_bank"
点击领取freeCredit:"click_free_credit"
点击promoCode:"click_promo_code"
成功註册:"sign_up_success"
成功验证OTP:"OTP_verification_success"
成功验证银行资料:"bank_verification_success"
登入成功:"login_success"
点击充值按钮:"click_deposit"
提交充值:"submit_deposit"
充值成功:"purchase"
首充成功:"first_deposit"
点击活动:"activity_click"
点击活动说明:"activity_detail"
点击进入游戏:"game_click"
大厅点击事件:"lobby_click"
搜寻事件:"search"
弹出错误视窗:"error_event"
params Json 参数:
currency(交易貨幣)
value(金额)
uidSite(用户id)

Firebase 傳送存款事件

purchase 事件需以 double 型態傳送 value 參數:

Bundle params = new Bundle();
params.putDouble("value", 3.99);
params.putString("currency", "USD" );

Documents

Documents

wiki

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published