Open thomas-alrek opened 4 years ago
I got the same situation... what's wrong?
Works just fine for me on iOS13.
Make sure you define window.handleOpenURL
ASAP - even before cordova onDeviceReady
Is the index.html before deviceReady enough? Still not working for me, even when emulating iOS 12.4 or on my devices iOS 13 devices.
Works for me on 13.2.1 Make sure to put the function on the DOM window object.
Anyone solved this yet? I have the impression it is not a iOS 13 but XCode 11 issue. Since our app build from Jenkins with an older XCode version works just fine.
Okay this works for me on iOS 13 from cold start and from resume.
Both of these are in a bare JS file included in the footer of the app. I have a 100% success rate with the below.
// This always fires but the app may not be fully loaded at times, so we store the url in
// localstorage rather than open the resource(must be attached to window object as below.
// It then attempts to open the resource
window.handleOpenURL = function(url) {
localStorage.setItem('share_url', url);
open_url(localStorage.getItem('share_url'));
};
// we run a timeout delay with 1 second which open the url from localstorage just in case the previous attempt in the above function did not work.
setTimeout(function() {
open_url(localStorage.getItem('share_url'));
}, 1000);
I got this working for my wevotetwitterscheme://
in my WeVoteCordova app by
deviceready
event is handled in the index.js
In my case the function openURL (AppDelegate.m) was overwritten by an other plugin (cordova-plugin-facebook4). So check out if some of your plugins using openURL. Copying the code from CDVAppDelegate.m openURL function into the AppDelegate.m fixed my problem.
I'm runing Xcode 11.3.1 and IOS 13.3 and I tried adding
window.handleOpenURL = function (url) {
setTimeout(function() {
alert("received url: " + url);
}, 0);
};
in my index.js before device start and also in another js and it doesn't get trigger on IOS is working for android but not for IOS. Anyone having similar issue
same here, handleOpenURL is not called on iOS... :/
I have the same issue, can't get is working on iOS. but after reviewing the code, there isn't any code for iOS in this plugin. Not even in the www folder. How does the app know how to call handleOpenURL at all?
Have anyone been able to get this to work under iOS 13?
The app does open when I open the custom scheme in Safari. But the
handleOpenURL
function never gets invoked.This did work prior to iOS 13.