Untitled

mail@pastecode.io avatar
unknown
java
a year ago
550 B
6
Indexable
Never
class WebAppInterface(private val mContext: Context) {

        /** Show a toast from the web page  */
        @JavascriptInterface
        fun postMessage(message: String) {

            val jsonModelMap = convertStringToJson(message).toMutableMap()

            when (jsonModelMap["type"].toString()) {
                "SendoExternalLogin" -> {
                    /** Function for login  */
                }
                "SendoExternalLogout" -> {
                    /** Function for logout  */
                }
            }
        }
    }