H5 與 原生APP交互(安卓 IOS )

H5與安卓交互:

自己規定好的參數.自己規定好的參數()   

例如:rich.callShareForMoreVipShare()

            如果需要帶參數:

            const imgUrl = 'https://111111.jpg';

            rich.callShareForMoreVipShare(qrUrl)

 

H5與IOS交互:

window.webkit.messageHandlers.自己規定好的參數.postMessage({}
例如:window.webkit.messageHandlers.callReadForMoreLottery.postMessage({})

     如果需要帶參數:

     const imgUrl = 'https://111111.jpg'
     window.webkit.messageHandlers.callReadForMoreLottery.postMessage({
       'imgUrl' : imgUrl
     })

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章