How to open skype from ionic 2 app


#1

Hi, this is my code but its not working plz help

var sApp;
if (this.platform.is(‘iOS’)) {
sApp = navigator.startApp.set(‘skype://’);
} else if (this.platform.is(‘android’)) {
sApp = navigator.startApp.set(
{ /* params /
“action”: “ACTION_MAIN”,
“category”: “CATEGORY_DEFAULT”,
“type”: “text/css”,
“package”: “com.lampa.startapp”,
“uri”: ‘com.skype.raider’,
“component”: [“com.app.name”, “com.app.name.Activity”],
“intentstart”: “startActivity”,
});
}
this.showToast(“Skype::” + sApp);
sApp.check(_ => { /
success /
sApp.start(_ => {
this.showToast(“Skype::success”);
},
error => { /
error */
this.showToast(“Skype could not be started!” + JSON.stringify(error));
});
}, error => {
this.showToast(“Skype is not installed!” + JSON.stringify(error));
});``


#2

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Can you define “not working” a bit? Do you get an error?
Where is it not working? What did you test?


#3

I want to open skype from my app. I refered this link http://itsmycodeshare.blogspot.in/2016/02/opening-other-apps-from-your-using.html but its not working neither open skype nor any error


#4

Plz help in how to open skype from my ionic 2 app


#5

add this line in config.xml
<allow-intent href="skype:*" />

then using an <a href> tag you can initiate a call

eg:

<ion-col ">
        <a href="skype:+1234567890?call">
               <button >
                        Click to open Skype and dial the no:+1234567890
              </button>
      </a>
 </ion-col>