zebview-bridge

0.5.3 • Public • Published

ZebView

Bridge between javascript and java on Android WebView

Get Start

There are two parts for getting start

Android Part

See ZebView for more information

Frontend Part

Add dependency

npm install zebview-bridge
//or
yarn add zebview-bridge

Call service

//Import
//If not in a ZebView's environmnet, api will be null
import {api} from 'zebview-bridge'

//Call native api
const res=api.TestService.test(789,"string",false)

//Support promise
api.TestService.manyWork().then(()=>{
    //promise resolve
}).catch(()=>{
    //promise reject
})

//Support return in callback
api.TestService.notifyJs((name)=>{
    return "my name is "+name
})

Readme

Keywords

none

Package Sidebar

Install

npm i zebview-bridge

Weekly Downloads

0

Version

0.5.3

License

none

Unpacked Size

18.8 kB

Total Files

12

Last publish

Collaborators

  • gogogoghost