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).
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.
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.