package cn.yyxx.eyuangame.core.impl

import android.webkit.JavascriptInterface
import cn.yyxx.eyuangame.base.utils.Logger
import cn.yyxx.eyuangame.core.internal.IJsCallback

/**
 * @author #Suyghur.
 * Created on 2021/07/28
 */
class SdkJsImpl(val callback: IJsCallback) {

    @JavascriptInterface
    fun jsInvoke(method: String, data: String) {
        Logger.d("jsInvoke method : $method , data : $data")
        callback.onInvoke(method, data)
    }

    @JavascriptInterface
    fun jsCallback(method: String, data: String): String {
        Logger.d("jsCallback method : $method , data : $data")
        return callback.onCallback(method, data)
    }
}