You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Aaron Moman (JIRA)" <ji...@apache.org> on 2012/11/13 19:00:13 UTC

[jira] [Created] (CB-1843) Echo plugin doesn't work in iOS

Aaron Moman created CB-1843:
-------------------------------

             Summary: Echo plugin doesn't work in iOS
                 Key: CB-1843
                 URL: https://issues.apache.org/jira/browse/CB-1843
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 2.2.0
         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
            Reporter: Aaron Moman
            Assignee: Shazron Abdullah


I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.

In index.js, after the var app = { ... }; statement I add:
window.echo = function(str, callback) {
    cordova.exec(callback, function(err) {
        callback('Nothing to echo.');
    }, "Echo", "echo", [str]);
};

Then in onDeviceReady I add the following after the receivedEvent call:
    window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });

I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.

Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.

What's going on here?  It seems like the example plug-in should work a little better than this.

The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.

Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.

Any help would be greatly appreciated.

Thanks,
Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496825#comment-13496825 ] 

Andrew Grieve commented on CB-1843:
-----------------------------------

Sure, that would be great. 

Also, when you said that you got the same behaviour, did y mean same as me, or same broken behaviour that you saw before?
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve reassigned CB-1843:
---------------------------------

    Assignee: Andrew Grieve  (was: Shazron Abdullah)
    
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Moman updated CB-1843:
----------------------------


I'm pushing up the status since this breaks a previously working app.  This is preventing me from being able to submit to the App Store.
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497772#comment-13497772 ] 

Aaron Moman commented on CB-1843:
---------------------------------

Huh.  I thought I'd reverted all the changes I'd made to the core library.  Obviously not.  Thanks for finding that!
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>            Priority: Critical
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve resolved CB-1843.
-------------------------------

    Resolution: Invalid

I think the copy of CDVViewController.m within your zipped project isn't the one from 2.2.

On line 493 of the file, yours has:
    NSString* nativeReady = [NSString stringWithFormat:@"window.iOSVCAddr='%lld';try{cordova.require('cordova/


It should read:
    NSString* nativeReady = [NSString stringWithFormat:@"cordova.iOSVCAddr='%lld';try{cordova.require('cordova/
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>            Priority: Critical
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497465#comment-13497465 ] 

Andrew Grieve commented on CB-1843:
-----------------------------------

Downloaded your link and it does repro for me! I'll look into why it's not working tomorrow.
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497220#comment-13497220 ] 

Aaron Moman commented on CB-1843:
---------------------------------

The same broken behavior.  Here's a link to the [project|http://arkmobile.fusionmedia.com/Apps/app-aaron/c22-echo-plugin.zip]. I included all the build files in case there's something in the way it's getting built that's different/wrong.  FYI - I see the same behavior with both the cordova debug/emulate scripts and Xcode.

Also, I just tried this with 4.3, 5.0 and 5.1 in the simulator.  All versions exhibit the same bug.  I do see the same behavior on device (iPad 2, iPhone 4) as well, both of those are iOS 6.

Thanks,
Aaron
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496639#comment-13496639 ] 

Aaron Moman commented on CB-1843:
---------------------------------

Do you want a copy of the app project since you can't reproduce?
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496409#comment-13496409 ] 

Aaron Moman commented on CB-1843:
---------------------------------

Ugh.  I forgot about that detail.  So, I worked around the fact that "Echo" was already defined to "CDVEcho" in Cordova.plist by using "EchoPlugin" instead of "Echo".  And, of course, I copy/pasted the code from the example not from my actual code when I added it to the issue. The code in window.echo is really:
cordova.exec(callback, function(err) { callback('Nothing to echo.'); }, "EchoPlugin", "echo", [str]);

Since it worked for you with "Echo", I tried that.  It should call CDVEcho and not my EchoPlugin now.  I got the same behavior.


                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Aaron Moman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Moman updated CB-1843:
----------------------------

    Priority: Critical  (was: Major)
    
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>            Priority: Critical
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1843) Echo plugin doesn't work in iOS

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496393#comment-13496393 ] 

Andrew Grieve commented on CB-1843:
-----------------------------------

Hey Aaron,

Could you try this same example except without the native code part? In 2.0 we added an Echo plugin to the core distro for benchmarking purposes and I'm wondering if it's conflicting here. I just tried creating a new project and adding the JS changes you listed (via copy & paste) and I go an alert(true) on start-up using the 6.0 iPad simulator.
                
> Echo plugin doesn't work in iOS
> -------------------------------
>
>                 Key: CB-1843
>                 URL: https://issues.apache.org/jira/browse/CB-1843
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.2.0
>         Environment: iPad2, iOS Simulator, iOS 6, XCode 4.5.2
>            Reporter: Aaron Moman
>            Assignee: Andrew Grieve
>
> I'm using the base application for iOS created with the create script.  That works correctly.  I add the Echo plugin example Objective-C code and everything compiles.  Then I add the JS to call it and that's when things get weird.
> In index.js, after the var app = { ... }; statement I add:
> window.echo = function(str, callback) {
>     cordova.exec(callback, function(err) {
>         callback('Nothing to echo.');
>     }, "Echo", "echo", [str]);
> };
> Then in onDeviceReady I add the following after the receivedEvent call:
>     window.echo("echome", function(echoValue) { alert(echoValue == "echome"); });
> I run the app and I get the green glowing "Device is ready" message.  So we're getting into onDeviceReady successfully.  But the "true" alert never pops up.
> Until I double-click on the home button.  Then when the running apps show at the bottom of the screen, then the alert pops up.  I tap back into the app and I can click to dismiss the alert.
> What's going on here?  It seems like the example plug-in should work a little better than this.
> The reason I'm doing this at all is that I'm seeing similar behavior in my app that I'm currently failing to upgrade from 2.1 to 2.2.
> Worse: If I single-click the home button and then go back to the app, I get the alert pop-up, but after I click on it the screen goes black.
> Any help would be greatly appreciated.
> Thanks,
> Aaron

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira