[ 
https://issues.apache.org/jira/browse/CB-10631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15151929#comment-15151929
 ] 

jcesarmobile commented on CB-10631:
-----------------------------------

I was just giving my opinion why I think this shouldn't be merged. But it's 
*my* opinion, you should send a mail to [email protected] so we can 
discuss it. I was not accurate when I said "there is no way", I meant for 
regular users, the projects are created with iOS 7 deployment target and the 
cordovaLib project too. From cordova 3 you shouldn't change anything on the 
xcodeproj yourself, so we don't expect users to change deployment target. Drop 
support doesn't mean that it doesn't work, just that we don't test it and isn't 
taken into account when we make decissions. But is good to know that Cordova 
5.4.1 apps still work on iOS 5.

This fix seems simple and only add 5 new lines, but adding iOS 5 support on 
every plugin will add complexity and most of us can't even test on iOS 5.

BTW, the old code was like this:

{code}
CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault); 
CFStringRef uuidString = CFUUIDCreateString(kCFAllocatorDefault, uuidRef); 
app_uuid = [NSString stringWithString:(__bridge NSString*)uuidString]; 
CFRelease(uuidString); 
CFRelease(uuidRef);
{code}

You managed to do the same with a single line
{code}
app_uuid = (__bridge NSString *) CFUUIDCreateString(NULL, CFUUIDCreate(NULL));
{code}

But I don't think it's right, I think you should at least release the 
CFUUIDRef, and use __bridge_transfer or release the CFStringRef if using 
__bridge.
{code}
CFUUIDRef uuid = CFUUIDCreate(NULL);
app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
{code}

> device is not populated in iOS 5.1.1
> ------------------------------------
>
>                 Key: CB-10631
>                 URL: https://issues.apache.org/jira/browse/CB-10631
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Device
>         Environment: iOS 5.1.1
>            Reporter: Thomas Allen
>            Priority: Minor
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The device plugin doesn't work in iOS 5.1.1 because the unique device 
> identifier uses identifierForVendor to get the device uuid. However this is 
> not valid in iOS older than 6.0.
> In the method uniqueAppInstanceIdentifier, there is a reference to 
> maintaining backward compatibility for versions that didn't use 
> identiferForVendor. Unfortunately the code only works if the app had 
> previously been installed on that device (because it looks for the CDVUUID 
> that was previously stored on the device). If the install is new, this 
> app_uuid is nil and it tries to use identifierForVendor.
> I realize that iOS 5 is no longer supported in Cordova, but since the code 
> attempts to be backward compatible (based on the inline comments), I figured 
> this could be fixed with a few lines of code (which I have done and will 
> submit shortly).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to