[
https://issues.apache.org/jira/browse/CB-1066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rohde Fischer updated CB-1066:
------------------------------
Description:
When I switch to another application (such as Safari) and follow a link that
leads to my application such as: myapp://some/path the window.invokeString is
not set to "myapp://some/path" as I expect.
To reproduce, create an custom url schema for the app add this to the app:
document.addEventListener("resume", function() {
console.log("Invoke: " + window.invokeString);
}, false);
Exit the app and follow a link that leads to the app.
I suspect that the bug should be fixed by adding something like this to the
resume:
if (self.invokeString)
{
// this is passed before the deviceready event is fired, so you can
access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString =
\"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
The code is taken from MainViewController.m
was:
When I switch to another application (such as Safari) and follow a link that
leads to my application such as: myapp://some/path the window.invokeString is
not set to "myapp://some/path" as I expect.
To reproduce, create an custom url schema for the app add this to the app:
document.addEventListener("resume", function() {
console.log("Invoke: " + window.invokeString);
}, false);
Exit the app and follow a link that leads to the app.
I suspect that the bug should be fixed in CordovaLib/Classes/CDVConnection.m,
by adding something like this to onResume():
if (self.invokeString)
{
// this is passed before the deviceready event is fired, so you can
access it in js when you receive deviceready
NSString* jsString = [NSString stringWithFormat:@"var invokeString =
\"%@\";", self.invokeString];
[theWebView stringByEvaluatingJavaScriptFromString:jsString];
}
The code is taken from MainViewController.m
> window.invokeString is not set on resume
> ----------------------------------------
>
> Key: CB-1066
> URL: https://issues.apache.org/jira/browse/CB-1066
> Project: Apache Cordova
> Issue Type: Bug
> Affects Versions: 1.9.0
> Environment: iOS 4.1
> Reporter: Rohde Fischer
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When I switch to another application (such as Safari) and follow a link that
> leads to my application such as: myapp://some/path the window.invokeString is
> not set to "myapp://some/path" as I expect.
> To reproduce, create an custom url schema for the app add this to the app:
> document.addEventListener("resume", function() {
> console.log("Invoke: " + window.invokeString);
> }, false);
> Exit the app and follow a link that leads to the app.
> I suspect that the bug should be fixed by adding something like this to the
> resume:
> if (self.invokeString)
> {
> // this is passed before the deviceready event is fired, so you can
> access it in js when you receive deviceready
> NSString* jsString = [NSString stringWithFormat:@"var invokeString =
> \"%@\";", self.invokeString];
> [theWebView stringByEvaluatingJavaScriptFromString:jsString];
> }
> The code is taken from MainViewController.m
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira