I'm trying to launch an external app from within my Ionic app. For example, Instagram. I'm attempting this with Lampaa's Startapp plug in, and have followed a few previous examples with no success.
Here's the code inside the controller, called on an ng-click=""
. I've tried to explain in comments what each step is attempting. I'd also like to add an app.availability to check if the app is installed, but couldn't work out how to do this either. Thanks!
$scope.onInstagramClick = function () {
// Check if
if (ionic.Platform.isAndroid()) {
// Using plugin com.lampa.startapp to launch the app for android
navigator.startApp.set({
"package": "com.instagram.android",
}).start();
} else {
if (ionic.Platform.isIOS() || ionic.Platform.isIPad()) {
console.log('ios');
navigator.startApp.set({
"package": "instagram://",
}).start();
} else {
console.log('thisfailed.');
};
}
}