Then the last article on the JS call third-party map problem, the previous way is through a link directly to third-party web pages, and third-party web pages called third-party apps; As a result, this method is denied because the demand is not so, the need to call third-party apps directly.
Because the project is written based on the MUI Framework, the MUI itself encapsulates the method that invokes the third-party app. So, the runtime module in the official document wrote how to invoke it.
Let's start with a brief introduction to the runtime module. The runtime module manages the operating environment, which can be used to obtain information about the current operating environment, communicate with other programs, and so on. General use Plus.runtime to obtain the running environment management object.
Property:
- Version: Gets the build number of the client
- Innerversion: Gets the version number of the client runtime environment
- Arguments: Gets the arguments passed to the program when a third-party program is called
- AppID: Get the current app's AppID
Method:
- GetProperty: Gets the application information for the specified AppID
- Install: Installing the App
- Quit: Quit the client program
- Restart: Restarting the current app
- Setbadgenumber: Set the number of prompts displayed on the program shortcut
- OpenURL: Call a third-party program to open the specified URL
- OpenFile: Call a third-party program to open the specified file
- launchapplication: Calling a third-party program
The Red method can call third-party apps directly. But we need to know the package name of the third-party app we're calling, because the app's package name will be used on Android, and it won't be available on iOS. Just look at the code.
//calling a third-party programfunctionlaunchtest () {if(Plus.os.name = = "Android") {plus.runtime.launchApplication ({pname:"Third-party app package name", Extra:{url:"Third-party-provided URI"}},function(e) {alert ("Open system default Browser failed:" +e.message); } ); } Else if(Plus.os.name = = "IOS"{plus.runtime.launchApplication ({action:"Third-party-provided URI"},function(e) {alert ("Open system default Browser failed:" +e.message); } ); }}
How to use JS to pick up a third-party map in the app--take the German map and Baidu map for example (2)