How to use JS in the app to pick up the third-party map of the mobile phone-with the German map and Baidu map for example (2)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.