h5与app交互

function callAndroid(obj){
    meetfitjs.callShareSdk(JSON.stringify(obj));
}
function callShareSdk() {
    test.hello(JSON.stringify(obj))
}
function testDemo(obj) {
    var u = navigator.userAgent;
    if (u.indexOf(‘Android‘) > -1 || u.indexOf(‘Adr‘) > -1) {
        callAndroid(obj)
    } else if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
        window.webkit.messageHandlers.callShareSdk.postMessage({body: JSON.stringify(obj)})
    }
}

 

h5与app交互

上一篇:jeecg环境搭建20160707


下一篇:新版chrome移动端踩坑