Custom-URL-scheme
Custom-URL-scheme copied to clipboard
handleOpenURL not firing on iOS cold start
I'm on Cordova 3.8.0 and my handleOpenURL function is not firing on a cold start of the app. It works fine if the app is already open, and works great on Android.
I'm assuming it's related to https://issues.apache.org/jira/browse/CB-7606.
tried to change the version to 3.6.3, still its not working on IOS.
have you found a solution? I have the same problem
Same problem here on Android 5.1 and possibly lower versions too.
Same with Android 5.0.1
If anyone can reproduce this problem with a vanilla cli generated project then I'd be more than happy to take a look. With something like Meteor in the mix you're on your own.
I'm having the same issue with Ionic framework, tried different tips that I've found on web but none of them are working; my scenario throws this error: Failed to load webpage with error: Frame load interrupted
.
I am using cordova 4.0.0-dev and still have this issue. Any progress?
@martindrapeau see my comment of July 9th. That offer still stands.
Fair enough - I think we are all using frameworks and wrappers. Cocoon.io in my case. I will see what I can do and get back to you...
As usual, adding a little delay solves the problem, at least for me...
function handleOpenURL(url) {
setTimeout(function() {
actuallyHandleOpenURL(url);
}, 500);
}
function actuallyHandleOpenURL(url) {
...
}
(i'm on angular 1.3.13 / ionic 1.0.1 / react 0.13.3, lots' of 3's there...)
still not working @possan is there any solution?
What's your setup like? The more details the better.
I don't understand the question, sorry eddy :(
I build with Intel XDK cordova solution. It work for android, and not for iOS when the app is shut. Works when the app in in background. Setup is ipa
@xale76 You're describing the symptoms of an issue in Cordova-iOS 3.7.0 - which version are you using?
cordova cli? 4.1.2
No Cordova-iOS, please check it and move to anything else than 3.7.0.
where I can find this information?
I don't use XDK and please don't mistake me for Google :)
Same problem, someone fixed it?
i got the same problem, someone solved it?
@vhuerta thanks for asking twice. What version of cordova-ios are you on? Not cordova-cli.
Im using the 3.9.1 version
Can you share your code with me perhaps?
sure there is, im using Meteor but basically when i open the app from cold always im getting the index page
window.handleOpenURL = function handleOpenURL(url) {
setTimeout(function() {
if(Meteor.isCordova) {
var host = window.location.protocol + "//" + window.location.host;
if(url.indexOf('?external')) {
Router.go(url.replace('saxmovil://', ''));
}
}
}, 500);
};
Ah Meteor again. Anything in the adb log or js console?
Setting a 500 timeout worked for me.
setTimeout does not work for me too. Does anybody have a different solution?
@mmBs here is my modified meteor_cordova_loader. I put this in my-meteor-project/cordova-build-override/www/meteor_cordova_loader.js
https://gist.github.com/Exilz/3d50cf7614b982157faa
Cold start works like a charm on Android/iOS regardless of versions and phone's swiftness since it doesn't depend on timeout.
I guess it's quite risky for Meteor, though...
@Exilz thanks for that. I will try to adapt this approach to my implementation - i use backbone.js
I also HAD problems with handleOpenURL not being called on cold start. It worked fine on the iOS simulator but not on the actual device.
In my case I solved it by placing my handleOpenURL()-implementation in a script-element inside the body. Like so:
<body>
<script type="text/javascript">
function handleOpenURL(url) {
setTimeout(function() {
alert(url);
}, 0);
}
</script>
<!-- other html -->
</body>
On rare occasions it still doesn't work but I haven't been able to reproduce those bugs yet... This issue can also be merged with #2 imho.
(Oh, and @EddyVerbruggen, thanks for this awesome plugin!)