

English
The url scheme in Android is a page jump protocol. By defining your own scheme protocol, you can easily implement other three-party apps to call your app.
The UrlSchemes of the standard real machine running base of HBuilderX is "hbuilder://", which is convenient for developers to debug.
Visual interface configuration
Note: It is recommended to use lowercase letters for strings (do not use special characters, Chinese, etc.), if it is set to "test", then the scheme protocol of other apps calling your app is "test://"; Multiple schemes are separated by ",", each string is a scheme; If the visual interface cannot be edited, please switch to the "source view" to delete the
schemes
node data and re-operate.
Source view configuration Open the manifest.json file of the project, switch to the "source view", and configure according to the project type
"app-plus": {
"distribute": {
"android": {
"schemes": "hbuilder,myuniapp"
//...
},
//...
},
//...
},
//...
"plus": {
"distribute": {
"google": {
"schemes": "hbuilder,myuniapp"
//...
},
//...
},
//...
},
//...
Note: For backward compatibility, the
schemes
property value supports a string array when configuring the HBuilderX source view. The value in the above example can also be configured like this ["hbuilder","myuniapp"]
Submit the App cloud package to take effect after saving
After installing the application, we can directly call the application through href in the H5 page:
<a href="test://abc">test:<a><br/>
When other third-party apps start the app through scheme, the complete urlscheme string can be obtained through plus.runtime.arguments.
onshow
event of the application life cycle app.vue. The sample code is as follows:onShow: function() {
var args= plus.runtime.arguments;
if(args){
// Process args parameters, such as until a new page is reached, etc.
}
}
document.addEventListener('plusready',function(){
checkArguments();
},false);
// Determine the startup method
function checkArguments(){
console.log("plus.runtime.launcher: "+plus.runtime.launcher);
var args= plus.runtime.arguments;
if(args){
// Process args parameters, such as until a new page is reached, etc.
}
}
// handle resuming from background
document.addEventListener('newintent',function(){
console.log("addEventListener: newintent");
checkArguments();
},false);