Srijan
Srijan

Reputation: 43

How to open another app from ionic app?

I want to open an app in my phone from my ionic app. Along with that I want to send some data(as given below) too. I want to do this using uri scheme. URI for

Android: someapp://com.example.example/?someField=someData

iOS: someapp://?someField=someData

I have triend this but it's not working:

var browserRef = this.inAppBrowser.create(
        "twitter://com.twitter.android",
        "_system",
        "location=no,hidden=no,zoom=no"
);

however when i use url as https://twitter.com like below, it's working just fine.

var browserRef = this.inAppBrowser.create(
        'https://twitter.com',
        "_system",
        "location=no,hidden=no,zoom=no"
      );

but I can't use the http link as I want to send data in above specified format. Please help!!

My system configuration is:

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 1.3.12
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 26.1.1
    Node              : v8.6.0
    npm               : 4.6.1
    OS                : macOS Sierra
    Xcode             : Xcode 8.3.3 

Upvotes: 1

Views: 9958

Answers (1)

ggg
ggg

Reputation: 1192

Try to add this in your config.xml.

<access origin="someapp:*" launch-external="yes" />

Add this in your Whitelist, is needed to launch external application.

Upvotes: 3

Related Questions