2

I am working on a webapp developed in MEAN.JS. When I detect that the app is running on iPhone, I want to redirect it on a native app to do my WebRTC communication (as WebRTC is not supported on any of the iPhone's browser).

enter image description here

When I click on open, iOS9 takes me to the native app. But if I cancel this, for every successive time I try to open the native app again using the same link, it shows the following error.

enter image description here

In my app I have a ngDialog in which I call a function that calls an API to get token, then redirect it to the native app using the flowing code, and on closing the app it opens the link passed as url.

$scope.gotoApp = function () {
    if (isSafari) {
        $http.get('/api/users/video').then(function (res) {
            var seconds = 5 * 60;
            $window.location.href = 'x-checkdemo://?from=' + Authentication.user.username + '&genToken=' + res.data.token + '&url='+ location.origin + '&timeremain=' + seconds;
        });
    }
}

I also have injected all the required stuff like $http, $window and Authentication in my module controller.

  • There is nothing at the OS level that would be causing this (i.e., iOS does not 'remember' that you cancelled the the first time). It sounds like perhaps the URL is being consumed in the first attempt and then is no longer valid the second time you try. Is the URL being triggered on later attempts the same as the first one? – Alex Bauer Aug 03 '16 at 14:29

0 Answers0