uniapp H5与原生APP 安卓端和苹果端交互方法

技术 · 01-30

与苹果ios交互

动作方法名称 shareFriendsPoster ,还有参数传给ios,如果没有参数需要传null

const sharePosterConfigIOS = {
    posterImgUrl: unref(poster),
    drawId: id,
    activeCode: 'customer_coupon'
}

window.webkit.messageHandlers.shareFriendsPoster.postMessage(JSON.stringify(sharePosterConfigIOS))

与安卓交互

window.supportJs.shareFriendsPoster(unref(poster), unref(id),sharePosterConfig.activeCode)
uniapp
Theme Jasmine by Kent Liao