cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-10935) fix an issue of can not sync new contact into icloud which update new photo with ABPersonSetImageData()
Date Mon, 27 Nov 2017 20:19:01 GMT

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

ASF GitHub Bot commented on CB-10935:
-------------------------------------

maverickmishra closed pull request #109: CB-10935: fix an issue of can not sync new contact
into icloud which update new photo with ABPersonSetImageData()
URL: https://github.com/apache/cordova-plugin-contacts/pull/109
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/ios/CDVContact.m b/src/ios/CDVContact.m
index a1dd85d..eaef570 100644
--- a/src/ios/CDVContact.m
+++ b/src/ios/CDVContact.m
@@ -356,7 +356,11 @@ - (bool)setFromContactDict:(NSDictionary*)aContact asUpdate:(BOOL)bUpdate
                             data = [NSData dataWithContentsOfURL:photoUrl options:NSDataReadingUncached
error:&err];
                         }
                         if (data && ([data length] > 0)) {
-                            bSuccess = ABPersonSetImageData(person, (__bridge CFDataRef)data,
&error);
+                            // bSuccess = ABPersonSetImageData(person, (__bridge CFDataRef)data,
&error);
+                            // Direct base64 data into the ABPersonSetImageData can lead
to failure of synchronizing the contacts into icloud.
+                            // converted to JPEG format can fix this problem
+                            NSData *imageData = UIImageJPEGRepresentation([UIImage imageWithData:data],1);
+                            bSuccess = ABPersonSetImageData(person, (__bridge CFDataRef)imageData,
&error);
                         }
                         if (!data || !bSuccess) {
                             NSLog(@"error setting contact image: %@", (err != nil ? [err
localizedDescription] : @""));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> fix an issue of can not sync new contact into icloud which update new photo with ABPersonSetImageData()
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CB-10935
>                 URL: https://issues.apache.org/jira/browse/CB-10935
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-contacts (DEPRECATED)
>    Affects Versions: Master
>         Environment: iOS
>            Reporter: ryouaki
>             Fix For: Master
>
>
> I add contact with photo by cordova-plugin-contacts ,add to contacts successful.But the
contact can not be sync into icloud.
> If without photo can work fine that sync into icloud successful.
> I try to fix this issue and add commit by pushing to master 
> https://github.com/apache/cordova-plugin-contacts/pull/109



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message