         ("pager",ContactPhoneType.Other),
         ("other",ContactPhoneType.Other)
     ]
-
-    /**
-       Default Constructor.
+    
+    /**
+    Default Constructor.
     */
     public override init() {
         super.init()
     }
-
-    /**
-       Get all the details of a contact according to its id
-
-       @param contact  id to search for
-       @param callback called for return
-       @since ARP1.0
+    
+    /**
+    Get all the details of a contact according to its id
+    
+    @param contact  id to search for
+    @param callback called for return
+    @since ARP1.0
     */
     public func getContact(contact : ContactUid, callback : IContactResultCallback) {
         
         // fill all tthe group fields to query all the information
         var fields: [IContactFieldGroup] = [IContactFieldGroup.PERSONAL_INFO, IContactFieldGroup.PROFESSIONAL_INFO, IContactFieldGroup.ADDRESSES, IContactFieldGroup.PHONES, IContactFieldGroup.EMAILS, IContactFieldGroup.WEBSITES, IContactFieldGroup.SOCIALS, IContactFieldGroup.TAGS]
         
-        self.getContactsGeneric(callback, contact: contact, fields: fields, filter: nil, term: "")
-    }
-
-    /**
-       Get the contact photo
-
-       @param contact  id to search for
-       @param callback called for return
-       @since ARP1.0
+        self.checkContactPermissions(callback, contact: contact, fields: fields, filter: nil, term: "")
+        //self.getContactsGeneric(callback, contact: contact, fields: fields, filter: nil, term: "")
+    }
+    
+    /**
+    Get the contact photo
+    
+    @param contact  id to search for
+    @param callback called for return
+    @since ARP1.0
     */
     public func getContactPhoto(contact : ContactUid, callback : IContactPhotoResultCallback) {
         
         #if os(iOS)
             
-            if self.checkContactPermissions(nil, callbackPhoto: callback) {
-                
-                // Get the address book and the contact list
-                var addressBook: ABAddressBookRef? = extractABAddressBookRef(ABAddressBookCreateWithOptions(nil, nil))
-                
-                // Get the ID for the contact
-                var id:Int32 = Int32(contact.getContactId()!.toInt()!)
-                
-                if(ABAddressBookGetPersonWithRecordID(addressBook, id) == nil) {
-                    logger.log(ILoggingLogLevel.WARN, category: loggerTag, message: "The contact with id: \(id) is not founded in the address book for getting the picture")
-                    callback.onWarning([Byte](), warning: IContactPhotoResultCallbackWarning.No_Matches)
-                    return
-                }
-                
-                var person:ABRecordRef = Unmanaged.fromOpaque(ABAddressBookGetPersonWithRecordID(addressBook, id).toOpaque()).takeUnretainedValue()
-                logger.log(ILoggingLogLevel.DEBUG, category: loggerTag, message: "Quering for one person id: \(id)")
-                
-                // If the person has no photo
-                if !ABPersonHasImageData(person) {
-                    logger.log(ILoggingLogLevel.ERROR, category: loggerTag, message: "The contact with id: \(id) has NO photo")
-                    callback.onError(IContactPhotoResultCallbackError.No_Photo)
-                    return
-                }
-                
-                var image:NSData = Unmanaged.fromOpaque(ABPersonCopyImageData(person).toOpaque()).takeUnretainedValue()
-                
-                // Create an array and get the bytes for the image
-                let count = image.length
-                var array = [Byte](count: count, repeatedValue: 0)
-                image.getBytes(&array, length:count * sizeof(UInt32))
-                
-                // call the result callback
-                callback.onResult(array)
-            }
+            // Get the address book and the contact list
+            var addressBook: ABAddressBookRef? = extractABAddressBookRef(ABAddressBookCreateWithOptions(nil, nil))
+            
+            // Get the ID for the contact
+            var id:Int32 = Int32(contact.getContactId()!.toInt()!)
+            
+            if(ABAddressBookGetPersonWithRecordID(addressBook, id) == nil) {
+                logger.log(ILoggingLogLevel.WARN, category: loggerTag, message: "The contact with id: \(id) is not founded in the address book for getting the picture")
+                callback.onWarning([Byte](), warning: IContactPhotoResultCallbackWarning.No_Matches)
+                return
+            }
+            
+            var person:ABRecordRef = Unmanaged.fromOpaque(ABAddressBookGetPersonWithRecordID(addressBook, id).toOpaque()).takeUnretainedValue()
+            logger.log(ILoggingLogLevel.DEBUG, category: loggerTag, message: "Quering for one person id: \(id)")
+            
+            // If the person has no photo
+            if !ABPersonHasImageData(person) {
+                logger.log(ILoggingLogLevel.ERROR, category: loggerTag, message: "The contact with id: \(id) has NO photo")
+                callback.onError(IContactPhotoResultCallbackError.No_Photo)
+                return
+            }
+            
+            var image:NSData = Unmanaged.fromOpaque(ABPersonCopyImageData(person).toOpaque()).takeUnretainedValue()
+            
+            // Create an array and get the bytes for the image
+            let count = image.length
+            var array = [Byte](count: count, repeatedValue: 0)
+            image.getBytes(&array, length:count * sizeof(UInt32))
+            
+            // call the result callback
+            callback.onResult(array)
             
         #endif
         #if os(OSX)

                
                ABAddressBookRequestAccessWithCompletion(addressBook, { (success, error) -> Void in
                    if success {
                        self.logger.log(ILoggingLogLevel.DEBUG, category: self.loggerTag, message: "Addres Book authorization NOT DETERMINED but correct")
                        ret = true
                    }
                    else {
                        self.logger.log(ILoggingLogLevel.ERROR, category: self.loggerTag, message: "Addres Book authorization NOT DETERMINED")
                        
                        if let call = callback {
                            call.onError(IContactResultCallbackError.NoPermission)
                        } else if let call = callbackPhoto {
                            call.onError(IContactPhotoResultCallbackError.NoPermission)
                        }
                        
                        ret = false
                    }
                })
            }


Original author:

* Carlos Lozano Diez
<http://github.com/carloslozano>
<http://twitter.com/adaptivecoder>
<mailto:carlos@adaptive.me>

Contributors:

* Ferran Vila Conesa
<http://github.com/fnva>
<http://twitter.com/ferran_vila>
<mailto:ferran.vila.conesa@gmail.com>

* See source code files for contributors.

Release:

* @version v2.0.2

-------------------------------------------| aut inveniam viam aut faciam |--------------------------------------------
*/
