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

[jira] [Created] (CB-254) All input parameters in iOS backend methods are strings

All input parameters in iOS backend methods are strings
-------------------------------------------------------

                 Key: CB-254
                 URL: https://issues.apache.org/jira/browse/CB-254
             Project: Apache Callback
          Issue Type: Bug
          Components: iOS
    Affects Versions: 1.4.0
         Environment: Xcode 4.2 Mac OS X 10.7
            Reporter: Oleg Gryb
            Assignee: Shazron Abdullah


Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
e.g. in JS I can write something like this:
        
        return PhoneGap.exec(successCallback,
                             failureCallback, 
                             VPCLASS,  
                             'method',
                             ["str", 0, 1]);
 
but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
-(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options

In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Updated] (CB-254) All input parameters in iOS backend methods are strings

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

Shazron Abdullah updated CB-254:
--------------------------------

    Fix Version/s: 1.6.0

Slating this for 1.6.0 when we have our new cordova-js implementation.
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Resolved] (CB-254) All input parameters in iOS backend methods are strings

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

Shazron Abdullah resolved CB-254.
---------------------------------

    Resolution: Fixed

Closing this since with my tests (without Fil's code) the arguments are deserialized properly into the proper classes.
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Shazron Abdullah commented on CB-254:
-------------------------------------

Currently the mainline JavaScript code of Cordova iOS does not have Fil's code from his branch, it is still the code that was released in 1.5.0, so I was surprised that I couldn't repro this bug.
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Oleg Gryb commented on CB-254:
------------------------------

I've tested this in the branches suggested by Filip Maj:
https://github.com/filmaj/incubator-cordova-js
https://github.com/filmaj/incubator-cordova-ios

I found out that the correct types are created for different data types: NSString for strings and NSNumber for integers.  I think, this will fix the described problem. The only thing that plugin developers would need to do is to get rid of data conversion in their iOS methods if they used version 1.4.1 ( or older).

See also my suggetion in CB-255 about nulls. 
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Filip Maj commented on CB-254:
------------------------------

So given this is fixed with cordova-js integration (is that correct?), can we close this issue?
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Oleg Gryb commented on CB-254:
------------------------------

@Shazron - yes, this is consistent with my tests for Filip Cordova's branch (see above) after I've applied JS changes that I've suggested in CB-255. It should close CB-254 and CB-255. When you close, please provide the version where the Filip's branch will be merged to. 
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Oleg Gryb commented on CB-254:
------------------------------

@Filip If you close, please provide the version where the quoted branch will be merged to, because now it builds 1.4.1 and this is where the bug was found. 

Please also take a look at CB-255 and what I've suggested there.
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Updated] (CB-254) All input parameters in iOS backend methods are strings

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

Filip Maj updated CB-254:
-------------------------

    Component/s: CordovaJS
    
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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

        

[jira] [Commented] (CB-254) All input parameters in iOS backend methods are strings

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

Shazron Abdullah commented on CB-254:
-------------------------------------

After fixing CB-255 (post 1.5), and running this code (as an example):

{code}
return PhoneGap.exec(successCallback,
failureCallback, 
VPCLASS, 
'method',
["str", 0, null, 1]);
{code}

When I print out class names of the items in the arguments array using -
{code}
    NSLog(@"%@", NSStringFromClass([[arguments objectAtIndex:i] class]));
{code}

I get:
{code}
__NSCFString
__NSCFNumber
NSNull
__NSCFNumber
{code}

so I believe this is fixed? Unless you can provide a test case to repro.
                
> All input parameters in iOS backend methods are strings
> -------------------------------------------------------
>
>                 Key: CB-254
>                 URL: https://issues.apache.org/jira/browse/CB-254
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 1.4.0
>         Environment: Xcode 4.2 Mac OS X 10.7
>            Reporter: Oleg Gryb
>            Assignee: Shazron Abdullah
>             Fix For: 1.6.0
>
>
> Input parameters in 'arguments' array contain NSString types only, no matter what was passed in JS,
> e.g. in JS I can write something like this:
>         
>         return PhoneGap.exec(successCallback,
>                              failureCallback, 
>                              VPCLASS,  
>                              'method',
>                              ["str", 0, 1]);
>  
> but 'arguments' below will contain NSStrring types @"0" and @"1" instead of integers in the method below
> -(void)method:(NSMutableArray *)arguments withDict:(NSMutableDictionary *)options
> In Android there was a method data.getInt that I could use to retrieve an integer, but I didn't see anything like that in iOS

--
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