Open murliatdure opened 8 years ago
handleOpenURL() doesn't gets triggered if the app is already running in background for ios and android also.
Any alternatives to support the same?
Any update on handleOpenURL() function call while app resume?
or forcefully call or alternative plugin for supporting the same?
This sounds similar to what I have reported - #229.
Same problem.
Same problem here. LaunchMyApp.js is never getting executed????????? which never executing handleOpenURL().
Who is executing the LaunchMyApp.js atleast?
On Android: this is never getting executed. https://github.com/EddyVerbruggen/Custom-URL-scheme/blob/master/www/android/LaunchMyApp.js
@murliatdure have you found a way to make it work ?
Ok i found a way to fix it :
I was using two times
document.addEventListener('deviceready', onDeviceReady, false)
and using this in the wrong one :
window.handleOpenURL = function (url) {
setTimeout(function() {
alert(url);
}, 0);
};
So be sure you don't have other listeners of deviceready
that could break triggering handleOpenURL
@Aarbel - could you clarify your answer please. Using ionic i have the following, however it only works if app is not running in the background, how do I get it to work if app is already open in background?
.run(function($ionicPlatform,$state,$rootScope,$q,$ionicPopover,apiService) {
$ionicPlatform.ready(function() {
window.handleOpenURL = function(url) {
setTimeout(_ => {
var parsed = new URL(url);
var search = parsed.search.substring(1);
var inObj = JSON.parse('{"' + search.replace(/&/g, '","').replace(/=/g,'":"') + '"}', function(key, value) { return key===""?value:decodeURIComponent(value) }) ;
if (parsed.pathname == "//l") {
if (inObj.l == 1) {
setDB("app_whipLogin",1) ;
whipLogin = inObj ;
}
}
}) ;
}
}) ;
Can we force if target app is already opened?