Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

External App launched at Start of the mainApp

$
0
0

@Ramo wrote:

Skype and Hangouts are started when I start the main application. Without that I have executed them. How can I prevent that they don't start right at the start of the main app? I want that the apps just start when the buttons "launch Skype" and "launch Hangouts" clicked. They shouldn't be started automatically.

function launchApp($ionicPopup, appConfig) {
    var scheme;

    if (device.platform === 'iOS') {
        scheme = appConfig.iosScheme;
    } else if (device.platform === 'Android') {
        scheme = appConfig.androidScheme;
    } else if (device.platform === 'wp') {
        scheme = appConfig.wpScheme;
    } else if (device.platform === 'windows8') {
        scheme = appConfig.windows8Scheme;
    }

    navigator.startApp.check(scheme, function(message) { /* success */
        navigator.startApp.start(scheme, function(message) {
            }, function(error) { /* error */
            $ionicPopup.alert({
                title: appConfig.appName + " not started!",
                content: appConfig.appName + " not started!"
            })
        });
        }, function(error) {
        $ionicPopup.alert({
            title: appConfig.appName + " not installed!",
            content: appConfig.appName + " not installed! Please install it!"
        })
    });    
}

myApp.controller("launchSkypeCtrl", function($scope, $ionicPopup, $cordovaInAppBrowser) {
    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {
        var skypeConfig = {
            "appName": "Skype",
            "iosScheme": "skype://",
            "androidScheme": "com.skype.raider",
            "wpScheme": "skype:",
            "windows8Scheme": "skype:"
        }
        $scope.launchSkype = launchApp($ionicPopup, skypeConfig);
    }
});

myApp.controller("launchHangoutsCtrl", function($scope, $ionicPopup, $cordovaInAppBrowser) {
    document.addEventListener("deviceready", onDeviceReady, false);
    function onDeviceReady() {  
        var hangoutConfig = {
            "appName": "Google Hangouts",
            "iosScheme": "gtalk://",
            "androidScheme": "com.google.android.talk:",
            "wpScheme": "gtalk:",
            "windows8Scheme": "gtalk:"
        }
        $scope.launchHangouts = launchApp($ionicPopup, hangoutConfig);
    }
});

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>