Browse Source

fix iOS 8 compling errors

Arthur Wang 9 years ago
parent
commit
398e2c3c87

+ 2 - 2
ReactNativePermissions.xcodeproj/project.pbxproj

@@ -225,7 +225,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 9.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				MTL_ENABLE_DEBUG_INFO = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -262,7 +262,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 9.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				VALIDATE_PRODUCT = YES;

+ 4 - 1
permissions/RNPContacts.m

@@ -59,7 +59,10 @@
 #else
     CFErrorRef error = nil;
     ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, &error);
-    ABAddressBookRequestAccessWithCompletion(addressBook, completionHandler);
+    ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
+        NSError *err = (__bridge NSError *)error;
+        handler(granted, err);
+    });
 #endif
 }
 

+ 2 - 1
permissions/RNPPhoto.m

@@ -7,6 +7,7 @@
 //
 
 #import "RNPPhoto.h"
+#import <AddressBook/AddressBook.h>
 #import <AssetsLibrary/AssetsLibrary.h>
 
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0
@@ -59,7 +60,7 @@
 #else
     ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
     [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
-        handler()
+        handler();
         *stop = YES;
     } failureBlock:^(NSError *error) {
         handler();