-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(iOS) When the app is closed, handleOpenURL not run #29
Comments
Can you share your ios project with me so I can take a look? |
Found the solution. for iOS. As I am redirecting the page from index.html to main.html for fixing cannot resolve "index.html" issue, I put one more handleOpenURL function in the index.js, index.js is included in the main.html. |
Glad you solved it. |
@Netpolice could you explain exactly how you resolve this issue? I have the same problem and I cannot fix it whit your instructions. Thanks. |
@aabilio try my comment #2 (comment) This resolved the issue for me. |
@terikon thanks for your reply. I using this plugin just for iOS and finally solved the problem. index.html: <!DOCTYPE html>
<html>
<head>
<title>WOW</title>
<script>
// New
handleOpenURL = function (url) {
setTimeout(function(){
window.localStorage.fromuri = url;
},0);
};
//
window.location = "./main.html";
</script>
</head>
<body>
</body>
</html> main.html: <html>
<head>
<script>
var handleOpenURL;
handleOpenURL = function (url) {
alert("THIS IS EXECUTING WHERE APP IS OPEN IN BACKGORUND: "+url);
};
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
if ( window.localStorage.fromuri != undefined && window.localStorage.fromuri != 'undefined' ) {
url = window.localStorage.fromuri;
window.localStorage.fromuri = undefined;
alert("THIS IS EXECUTING WHERE APP IS INITIALY CLOSE: "+url);
}
};
</script>
</head>
<body>
<!-- ... -->
</body>
</html> That is working for me. |
@aabilio Nice, thank you for sharing. Anyway, I have only one page in my app. |
Under iOS, the function handleOpenURL not run when the app is closed.
However, if the app is launched but in the background, the function handleOpenURL will run.
Any solution for this issue? Thanks!
The text was updated successfully, but these errors were encountered: