Browse Source

fix iOS 8 compling errors

Arthur Wang 8 years ago
parent
commit
398e2c3c87

+ 2
- 2
ReactNativePermissions.xcodeproj/project.pbxproj View File

225
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
225
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
226
 				GCC_WARN_UNUSED_FUNCTION = YES;
226
 				GCC_WARN_UNUSED_FUNCTION = YES;
227
 				GCC_WARN_UNUSED_VARIABLE = YES;
227
 				GCC_WARN_UNUSED_VARIABLE = YES;
228
-				IPHONEOS_DEPLOYMENT_TARGET = 9.1;
228
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
229
 				MTL_ENABLE_DEBUG_INFO = YES;
229
 				MTL_ENABLE_DEBUG_INFO = YES;
230
 				ONLY_ACTIVE_ARCH = YES;
230
 				ONLY_ACTIVE_ARCH = YES;
231
 				SDKROOT = iphoneos;
231
 				SDKROOT = iphoneos;
262
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
262
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
263
 				GCC_WARN_UNUSED_FUNCTION = YES;
263
 				GCC_WARN_UNUSED_FUNCTION = YES;
264
 				GCC_WARN_UNUSED_VARIABLE = YES;
264
 				GCC_WARN_UNUSED_VARIABLE = YES;
265
-				IPHONEOS_DEPLOYMENT_TARGET = 9.1;
265
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
266
 				MTL_ENABLE_DEBUG_INFO = NO;
266
 				MTL_ENABLE_DEBUG_INFO = NO;
267
 				SDKROOT = iphoneos;
267
 				SDKROOT = iphoneos;
268
 				VALIDATE_PRODUCT = YES;
268
 				VALIDATE_PRODUCT = YES;

+ 4
- 1
permissions/RNPContacts.m View File

59
 #else
59
 #else
60
     CFErrorRef error = nil;
60
     CFErrorRef error = nil;
61
     ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, &error);
61
     ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(nil, &error);
62
-    ABAddressBookRequestAccessWithCompletion(addressBook, completionHandler);
62
+    ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
63
+        NSError *err = (__bridge NSError *)error;
64
+        handler(granted, err);
65
+    });
63
 #endif
66
 #endif
64
 }
67
 }
65
 
68
 

+ 2
- 1
permissions/RNPPhoto.m View File

7
 //
7
 //
8
 
8
 
9
 #import "RNPPhoto.h"
9
 #import "RNPPhoto.h"
10
+#import <AddressBook/AddressBook.h>
10
 #import <AssetsLibrary/AssetsLibrary.h>
11
 #import <AssetsLibrary/AssetsLibrary.h>
11
 
12
 
12
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0
13
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0
59
 #else
60
 #else
60
     ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
61
     ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
61
     [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
62
     [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
62
-        handler()
63
+        handler();
63
         *stop = YES;
64
         *stop = YES;
64
     } failureBlock:^(NSError *error) {
65
     } failureBlock:^(NSError *error) {
65
         handler();
66
         handler();