2

In NativeScript, is it possible to launch another app from within a Nativescript app?

Let's say I have a button in an app and when pressed it launches the Waze Navigation app with coordinates to a location.

Is this possible with NativeScript?

Thanks.

2 Answers 2

6

Waze uses the url scheme 'waze://' which you will need to first register in your Info.plist if your app will be running on devices w/ iOS 9 and later.

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>waze</string>
    </array>

You can then use the openUrl method from the included utils module

var utils = require('utils/utils');
utils.openUrl('waze://?ll=37.44469,-122.15971&z=10');

The NativeScript openUrl handles both the canOpenURL and subsequent openURL for you

Sign up to request clarification or add additional context in comments.

1 Comment

This is the correct answer to implement Waze. Thanks Stephen.
3

Should be easy, kinda works with schemes on both platforms...just convert this code to JS for iOS, find the equivalent for android.

How to launch another app from an iPhone app

The answer to "In Nativescript is it possible" is pretty much always yes since we're just marshalling calls into the OS' not needing native wrappers or anything around functionality.

Good luck!

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.