# wx.miniapp.registOpenURL

iOS >= 1.0.17,Android >= 1.0.8

Listens for events entering the app and gets parameters. The developer can listen in on the passing Scheme,Universal Link, WeChat open label wx-open-launch-app To enter the event of the app and carry parameters.

# Scheme

Developers who wish to use Scheme Jump App, you need to be in the project.miniapp.json Setting in Scheme Configuration such as the name of the(Attention, Android and iOS Configuration location is different, you can refer to the screenshot below)

Please use the developer tools 1.06.2307312 And above version

  • iOS: Application configuration(info.plist)The URL below Types configuration, refer to theApple Docs
  • Android: Other configurations -> URL Schemes Configuration, Fill Out scheme Fields.

If the scheme is weauth, then after installing the application, you can use the href Direct Call Application

<a href="weauth://Page/a/b?query=test">test:<a><br/>

Dxplaination: a The writing of the tag is not valid in the WeChat browser, you should use the WeChat open tag. For details, please see wx-open-launch-app

  • Universal Link only iOS Support

  • iOS When the app is built, it will be registered using the WeChat open platform. Universal Link, developers need to configure it in accordance with Apple's official documentationapple-app-site-associationEtc set.

# WeChat Open Label wx-open-launch-app

WeChat Open LabelGetting to the bottom of a multiterminal application is still the same way, but with its own data format.

Note: In iOS Case, because the WeChat open label underlying all are based on scheme or Universal Link Way to enter App, so it will be triggered first action For other types of callbacks, trigger again opensdkOnRep typeAndroid be No.

# JSAPI Examples of code

wx.miniapp.registOpenURL ((param) => {
    console.log('regsitOpenUrl',  param)
})

# Callback parameter

attribute type Introductions
action string Ways to evoke apps: 'scheme', 'webpageURL', 'opensdkOnRep'
Data object Carry Details
// If the scheme enters
const param = {
    action: 'scheme',
    data: {
        url: 'xxx', 
        host: 'xxx', 
        path: 'xxx', 
        query: 'xxx' 
    }
}
// If it is universal Link Entry
const param = {
    action: 'webpageURL',
    data: {
        url: 'xxx', 
        host: 'xxx', 
        path: 'xxx', 
        query: 'xxx' 
    }
}
// If the WeChat open label to enter
const param = {
    action: 'opensdkOnRep', 
    data: 'extraInfo' // String type pass through
}

# Open directly. App page

from iOS >= 1.1.13 Start, Support Scheme / Universal Link open App When carrying the corresponding parameters directly open App Page.

# To configure

iOS Developers using this feature need to project.miniapp.json Turn on the switch as shown below.

# Example

# Scheme

Directly in the Scheme Add the page path as follows:

YOUR_APP_SCHEME://pages/index/index?q=123

Page Parameter specifies the jump page. Note that the parameter needs to go through encodeURIComponent Transcoding, i.e.

'https://dev.weixin.qq.com/app?page=' + encodeURIComponent ('/pages/index/index?q=123')

->

https://dev.weixin.qq.com/app?page=%2Fpages%2Findex%2Findex%3Fq%3D123

# can't help SDK Processing the jump

Developers can enable new features by specifying parameters __donutDontNavigate __=true Give Way SDK The jump is not handled automatically, thus preserving the ability of the developer to handle it himself. As follows:

YOUR_APP_SCHEME://pages/index/index?q=123&__donutDontNavigate __=true

https://dev.weixin.qq.com/app?page=%2Fpages%2Findex%2Findex%3Fq%3D123&__donutDontNavigate __=true