├── .gitignore ├── .npmignore ├── RCTAddressBook.h ├── RCTAddressBook.m ├── RCTAddressBook.xcodeproj └── project.pbxproj ├── README.md ├── examples └── AddressbookDemo │ ├── .flowconfig │ ├── .gitignore │ ├── .npmignore │ ├── AddressbookDemo.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── AddressbookDemo.xcscheme │ ├── AddressbookDemoTests │ ├── AddressbookDemoTests.m │ └── Info.plist │ ├── components │ └── ContactList.js │ ├── iOS │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── main.jsbundle │ └── main.m │ ├── index.ios.js │ └── package.json ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | RCTAddressBook.xcodeproj/xcuserdata 3 | RCTAddressBook.xcodeproj/project.xcworkspace 4 | 5 | .npm-debug.log 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | -------------------------------------------------------------------------------- /RCTAddressBook.h: -------------------------------------------------------------------------------- 1 | #import "RCTBridgeModule.h" 2 | 3 | @interface RCTAddressBook : NSObject 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /RCTAddressBook.m: -------------------------------------------------------------------------------- 1 | @import AddressBook; 2 | #import 3 | #import "RCTAddressBook.h" 4 | 5 | @implementation RCTAddressBook 6 | 7 | RCT_EXPORT_MODULE(); 8 | 9 | - (NSDictionary *)constantsToExport 10 | { 11 | return @{ 12 | @"PERMISSION_DENIED": @"denied", 13 | @"PERMISSION_AUTHORIZED": @"authorized", 14 | @"PERMISSION_UNDEFINED": @"undefined" 15 | }; 16 | } 17 | 18 | RCT_EXPORT_METHOD(checkPermission:(RCTResponseSenderBlock) callback) 19 | { 20 | int authStatus = ABAddressBookGetAuthorizationStatus(); 21 | if ( authStatus == kABAuthorizationStatusDenied || authStatus == kABAuthorizationStatusRestricted){ 22 | callback(@[[NSNull null], @"denied"]); 23 | } else if (authStatus == kABAuthorizationStatusAuthorized){ 24 | callback(@[[NSNull null], @"authorized"]); 25 | } else { //ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined 26 | callback(@[[NSNull null], @"undefined"]); 27 | } 28 | } 29 | 30 | RCT_EXPORT_METHOD(requestPermission:(RCTResponseSenderBlock) callback) 31 | { 32 | ABAddressBookRequestAccessWithCompletion(ABAddressBookCreateWithOptions(NULL, nil), ^(bool granted, CFErrorRef error) { 33 | if (!granted){ 34 | [self checkPermission:callback]; 35 | return; 36 | } 37 | [self checkPermission:callback]; 38 | }); 39 | } 40 | 41 | RCT_EXPORT_METHOD(getContacts:(RCTResponseSenderBlock) callback) 42 | { 43 | ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, nil); 44 | int authStatus = ABAddressBookGetAuthorizationStatus(); 45 | if(authStatus != kABAuthorizationStatusAuthorized){ 46 | ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { 47 | if(granted){ 48 | [self retrieveContactsFromAddressBook:addressBookRef withCallback:callback]; 49 | }else{ 50 | NSDictionary *error = @{ 51 | @"type": @"permissionDenied" 52 | }; 53 | callback(@[error, [NSNull null]]); 54 | } 55 | }); 56 | } 57 | else{ 58 | [self retrieveContactsFromAddressBook:addressBookRef withCallback:callback]; 59 | } 60 | } 61 | 62 | -(void) retrieveContactsFromAddressBook:(ABAddressBookRef)addressBookRef 63 | withCallback:(RCTResponseSenderBlock) callback 64 | { 65 | NSArray *allContacts = (__bridge_transfer NSArray *)ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBookRef, NULL, kABPersonSortByLastName); 66 | int totalContacts = (int)[allContacts count]; 67 | int currentIndex = 0; 68 | int maxIndex = --totalContacts; 69 | 70 | NSMutableArray *contacts = [[NSMutableArray alloc] init]; 71 | 72 | while (currentIndex <= maxIndex){ 73 | NSDictionary *contact = [self dictionaryRepresentationForABPerson: (ABRecordRef)[allContacts objectAtIndex:(long)currentIndex]]; 74 | 75 | if(contact){ 76 | [contacts addObject:contact]; 77 | } 78 | currentIndex++; 79 | } 80 | callback(@[[NSNull null], contacts]); 81 | } 82 | 83 | -(NSDictionary*) dictionaryRepresentationForABPerson:(ABRecordRef) person 84 | { 85 | NSMutableDictionary* contact = [NSMutableDictionary dictionary]; 86 | 87 | NSNumber *recordID = [NSNumber numberWithInteger:(ABRecordGetRecordID(person))]; 88 | NSString *firstName = (__bridge_transfer NSString *)(ABRecordCopyValue(person, kABPersonFirstNameProperty)); 89 | NSString *lastName = (__bridge_transfer NSString *)(ABRecordCopyValue(person, kABPersonLastNameProperty)); 90 | NSString *middleName = (__bridge_transfer NSString *)(ABRecordCopyValue(person, kABPersonMiddleNameProperty)); 91 | 92 | [contact setObject: recordID forKey: @"recordID"]; 93 | 94 | BOOL hasName = false; 95 | if (firstName) { 96 | [contact setObject: firstName forKey:@"firstName"]; 97 | hasName = true; 98 | } 99 | 100 | if (lastName) { 101 | [contact setObject: lastName forKey:@"lastName"]; 102 | hasName = true; 103 | } 104 | 105 | if(middleName){ 106 | [contact setObject: (middleName) ? middleName : @"" forKey:@"middleName"]; 107 | } 108 | 109 | if(!hasName){ 110 | //nameless contact, do not include in results 111 | return nil; 112 | } 113 | 114 | //handle phone numbers 115 | NSMutableArray *phoneNumbers = [[NSMutableArray alloc] init]; 116 | 117 | ABMultiValueRef multiPhones = ABRecordCopyValue(person, kABPersonPhoneProperty); 118 | for(CFIndex i=0;i `getAll`) 3 | 4 | ## API 5 | `getContacts` (callback) - returns *all* contacts as an array of objects 6 | `addContact` (contact, callback) - adds a contact to the AddressBook. 7 | `updateContact` (contact, callback) - where contact is an object with a valid recordID 8 | `deleteContact` (contact, callback) - where contact is an object with a valid recordID 9 | 10 | ####Permissions Methods (optional) 11 | `checkPermission` (callback) - checks permission to use AddressBook. 12 | `requestPermission` (callback) - request permission to use AddressBook. 13 | 14 | ## Usage Example 15 | ```js 16 | var AddressBook = require('react-native-addressbook') 17 | 18 | AddressBook.getContacts( (err, contacts) => { 19 | if(err && err.type === 'permissionDenied'){ 20 | // x.x 21 | } 22 | else{ 23 | console.log(contacts) 24 | } 25 | }) 26 | ``` 27 | 28 | ## Example Contact Record 29 | ```js 30 | { 31 | recordID: 1, 32 | lastName: "Jung", 33 | firstName: "Carl", 34 | middleName: "", 35 | emailAddresses: [{ 36 | label: "work", 37 | email: "carl-jung@example.com", 38 | }], 39 | phoneNumbers: [{ 40 | label: "mobile", 41 | number: "(555) 555-5555", 42 | }], 43 | thumbnailPath: "", 44 | } 45 | ``` 46 | 47 | ## Adding Contacts 48 | Currently all fields from the contact record except for thumbnailPath are supported for writing 49 | ```js 50 | var newPerson = { 51 | lastName: "Nietzsche", 52 | firstName: "Friedrich", 53 | emailAddresses: [{ 54 | label: "work", 55 | email: "mrniet@example.com", 56 | }], 57 | } 58 | 59 | AddressBook.addContact(newPerson, (err) => { /*...*/ }) 60 | ``` 61 | 62 | ## Updating and Deleting Contacts 63 | ```js 64 | //contrived example 65 | AddressBook.getContacts( (err, contacts) => { 66 | //update the first record 67 | let someRecord = contacts[0] 68 | someRecord.emailAddresses.push({ 69 | label: "junk", 70 | email: "mrniet+junkmail@test.com", 71 | }) 72 | AddressBook.updateContact(someRecord, (err) => { /*...*/ }) 73 | 74 | //delete the second record 75 | AddressBook.deleteContact(contacts[1], (err) => { /*...*/ }) 76 | }) 77 | ``` 78 | Update and delete reference contacts by their recordID (as returned by the OS in getContacts). Apple does not guarantee the recordID will not change, e.g. it may be reassigned during a phone migration. Consequently you should always grab a fresh contact list with `getContacts` before performing update and delete operations. 79 | 80 | You can also delete a record using only it's recordID like follows: `AddressBook.deleteContact({recordID: 1}, (err) => {})}` 81 | 82 | ##Permissions 83 | Permissions will automatically be checked and if needed requested upon calling getContacts. If you need more granular control you can using the checkPermission and requestPermission methods as follows: 84 | ```js 85 | AddressBook.checkPermission( (err, permission) => { 86 | // AddressBook.PERMISSION_AUTHORIZED || AddressBook.PERMISSION_UNDEFINED || AddressBook.PERMISSION_DENIED 87 | if(permission === 'undefined'){ 88 | AddressBook.requestPermission( (err, permission) => { 89 | // ... 90 | }) 91 | } 92 | if(permission === 'authorized'){ 93 | // yay! 94 | } 95 | if(permission === 'denied'){ 96 | // x.x 97 | } 98 | }) 99 | ``` 100 | 101 | ## Getting started 102 | 1. `npm install react-native-addressbook` 103 | 2. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 104 | 3. add `./node_modules/react-native-addressbook/RCTAddressBook.xcodeproj` 105 | 4. In the XCode project navigator, select your project, select the `Build Phases` tab and in the `Link Binary With Libraries` section add **libRCTAddressBook.a** 106 | 107 | ## Todo 108 | - [x] `checkPermission` & `requestPermission` 109 | - [x] `getContacts` (get all contacts) 110 | - [x] `addContact` 111 | - [x] Update and Delete methods 112 | - [ ] `getContacts` options (a la camera roll's getPhotos) 113 | - [x] Automatic permission check & request in `getContacts` 114 | - [ ] Contact Groups support 115 | 116 | ## Credits 117 | Thanks to @mattotodd whose [RCTAddressBook](https://github.com/mattotodd/react-native-addressbook-ios) this is largely derived from. 118 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ignore react-tools where there are overlaps, but don't ignore anything that 11 | # react-native relies on 12 | .*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js 13 | .*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js 14 | .*/node_modules/react-tools/src/browser/ui/React.js 15 | .*/node_modules/react-tools/src/core/ReactInstanceHandles.js 16 | .*/node_modules/react-tools/src/event/EventPropagators.js 17 | 18 | # Ignore commoner tests 19 | .*/node_modules/commoner/test/.* 20 | 21 | # See https://github.com/facebook/flow/issues/442 22 | .*/react-tools/node_modules/commoner/lib/reader.js 23 | 24 | # Ignore jest 25 | .*/react-native/node_modules/jest-cli/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | 32 | [options] 33 | module.system=haste 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-3]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-3]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | 43 | [version] 44 | 0.13.1 45 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # node.js 26 | # 27 | node_modules/ 28 | npm-debug.log 29 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # node.js 25 | # 26 | node_modules/ 27 | npm-debug.log 28 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/AddressbookDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; 11 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 12 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 13 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 14 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 15 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 16 | 00E356F31AD99517003FC87E /* AddressbookDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AddressbookDemoTests.m */; }; 17 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 18 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 19 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 20 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 21 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 22 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 23 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 1479F8531B69344C0043A101 /* libRCTAddressBook.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1479F8471B6934390043A101 /* libRCTAddressBook.a */; }; 26 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = AddressbookDemo; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 1479F8461B6934390043A101 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 1479F8401B6934390043A101 /* RCTAddressBook.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 145CC5701AED80100006342E; 98 | remoteInfo = RCTAddressBook; 99 | }; 100 | 1479F8481B6934390043A101 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 1479F8401B6934390043A101 /* RCTAddressBook.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 145CC57B1AED80100006342E; 105 | remoteInfo = RCTAddressBookTests; 106 | }; 107 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 112 | remoteInfo = RCTLinking; 113 | }; 114 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 119 | remoteInfo = RCTText; 120 | }; 121 | /* End PBXContainerItemProxy section */ 122 | 123 | /* Begin PBXFileReference section */ 124 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; 125 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 126 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 127 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 128 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 129 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 130 | 00E356EE1AD99517003FC87E /* AddressbookDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AddressbookDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 131 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 132 | 00E356F21AD99517003FC87E /* AddressbookDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AddressbookDemoTests.m; sourceTree = ""; }; 133 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 134 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 135 | 13B07F961A680F5B00A75B9A /* AddressbookDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AddressbookDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 136 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 137 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; 138 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 139 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 140 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 141 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; 142 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 143 | 1479F8401B6934390043A101 /* RCTAddressBook.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAddressBook.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/../../../react-native-addressbook/RCTAddressBook.xcodeproj"; sourceTree = ""; }; 144 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 145 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 146 | /* End PBXFileReference section */ 147 | 148 | /* Begin PBXFrameworksBuildPhase section */ 149 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 150 | isa = PBXFrameworksBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 157 | isa = PBXFrameworksBuildPhase; 158 | buildActionMask = 2147483647; 159 | files = ( 160 | 1479F8531B69344C0043A101 /* libRCTAddressBook.a in Frameworks */, 161 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 162 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 163 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 164 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 165 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 166 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 167 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 168 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 169 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 170 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | /* End PBXFrameworksBuildPhase section */ 175 | 176 | /* Begin PBXGroup section */ 177 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 181 | ); 182 | name = Products; 183 | sourceTree = ""; 184 | }; 185 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 189 | ); 190 | name = Products; 191 | sourceTree = ""; 192 | }; 193 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 197 | ); 198 | name = Products; 199 | sourceTree = ""; 200 | }; 201 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 205 | ); 206 | name = Products; 207 | sourceTree = ""; 208 | }; 209 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 213 | ); 214 | name = Products; 215 | sourceTree = ""; 216 | }; 217 | 00E356EF1AD99517003FC87E /* AddressbookDemoTests */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 00E356F21AD99517003FC87E /* AddressbookDemoTests.m */, 221 | 00E356F01AD99517003FC87E /* Supporting Files */, 222 | ); 223 | path = AddressbookDemoTests; 224 | sourceTree = ""; 225 | }; 226 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | 00E356F11AD99517003FC87E /* Info.plist */, 230 | ); 231 | name = "Supporting Files"; 232 | sourceTree = ""; 233 | }; 234 | 139105B71AF99BAD00B5F7CC /* Products */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 238 | ); 239 | name = Products; 240 | sourceTree = ""; 241 | }; 242 | 139FDEE71B06529A00C62182 /* Products */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 246 | ); 247 | name = Products; 248 | sourceTree = ""; 249 | }; 250 | 13B07FAE1A68108700A75B9A /* AddressbookDemo */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 254 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 255 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 256 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 257 | 13B07FB61A68108700A75B9A /* Info.plist */, 258 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 259 | 13B07FB71A68108700A75B9A /* main.m */, 260 | ); 261 | name = AddressbookDemo; 262 | sourceTree = ""; 263 | }; 264 | 146834001AC3E56700842450 /* Products */ = { 265 | isa = PBXGroup; 266 | children = ( 267 | 146834041AC3E56700842450 /* libReact.a */, 268 | ); 269 | name = Products; 270 | sourceTree = ""; 271 | }; 272 | 1479F8411B6934390043A101 /* Products */ = { 273 | isa = PBXGroup; 274 | children = ( 275 | 1479F8471B6934390043A101 /* libRCTAddressBook.a */, 276 | 1479F8491B6934390043A101 /* RCTAddressBookTests.xctest */, 277 | ); 278 | name = Products; 279 | sourceTree = ""; 280 | }; 281 | 78C398B11ACF4ADC00677621 /* Products */ = { 282 | isa = PBXGroup; 283 | children = ( 284 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 285 | ); 286 | name = Products; 287 | sourceTree = ""; 288 | }; 289 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 290 | isa = PBXGroup; 291 | children = ( 292 | 1479F8401B6934390043A101 /* RCTAddressBook.xcodeproj */, 293 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 294 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 295 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 296 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 297 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 298 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 299 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 300 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 301 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 302 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 303 | ); 304 | name = Libraries; 305 | sourceTree = ""; 306 | }; 307 | 832341B11AAA6A8300B99B32 /* Products */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 311 | ); 312 | name = Products; 313 | sourceTree = ""; 314 | }; 315 | 83CBB9F61A601CBA00E9B192 = { 316 | isa = PBXGroup; 317 | children = ( 318 | 13B07FAE1A68108700A75B9A /* AddressbookDemo */, 319 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 320 | 00E356EF1AD99517003FC87E /* AddressbookDemoTests */, 321 | 83CBBA001A601CBA00E9B192 /* Products */, 322 | ); 323 | indentWidth = 2; 324 | sourceTree = ""; 325 | tabWidth = 2; 326 | }; 327 | 83CBBA001A601CBA00E9B192 /* Products */ = { 328 | isa = PBXGroup; 329 | children = ( 330 | 13B07F961A680F5B00A75B9A /* AddressbookDemo.app */, 331 | 00E356EE1AD99517003FC87E /* AddressbookDemoTests.xctest */, 332 | ); 333 | name = Products; 334 | sourceTree = ""; 335 | }; 336 | /* End PBXGroup section */ 337 | 338 | /* Begin PBXNativeTarget section */ 339 | 00E356ED1AD99517003FC87E /* AddressbookDemoTests */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AddressbookDemoTests" */; 342 | buildPhases = ( 343 | 00E356EA1AD99517003FC87E /* Sources */, 344 | 00E356EB1AD99517003FC87E /* Frameworks */, 345 | 00E356EC1AD99517003FC87E /* Resources */, 346 | ); 347 | buildRules = ( 348 | ); 349 | dependencies = ( 350 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 351 | ); 352 | name = AddressbookDemoTests; 353 | productName = AddressbookDemoTests; 354 | productReference = 00E356EE1AD99517003FC87E /* AddressbookDemoTests.xctest */; 355 | productType = "com.apple.product-type.bundle.unit-test"; 356 | }; 357 | 13B07F861A680F5B00A75B9A /* AddressbookDemo */ = { 358 | isa = PBXNativeTarget; 359 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AddressbookDemo" */; 360 | buildPhases = ( 361 | 13B07F871A680F5B00A75B9A /* Sources */, 362 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 363 | 13B07F8E1A680F5B00A75B9A /* Resources */, 364 | ); 365 | buildRules = ( 366 | ); 367 | dependencies = ( 368 | ); 369 | name = AddressbookDemo; 370 | productName = "Hello World"; 371 | productReference = 13B07F961A680F5B00A75B9A /* AddressbookDemo.app */; 372 | productType = "com.apple.product-type.application"; 373 | }; 374 | /* End PBXNativeTarget section */ 375 | 376 | /* Begin PBXProject section */ 377 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 378 | isa = PBXProject; 379 | attributes = { 380 | LastUpgradeCheck = 0610; 381 | ORGANIZATIONNAME = Facebook; 382 | TargetAttributes = { 383 | 00E356ED1AD99517003FC87E = { 384 | CreatedOnToolsVersion = 6.2; 385 | TestTargetID = 13B07F861A680F5B00A75B9A; 386 | }; 387 | }; 388 | }; 389 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AddressbookDemo" */; 390 | compatibilityVersion = "Xcode 3.2"; 391 | developmentRegion = English; 392 | hasScannedForEncodings = 0; 393 | knownRegions = ( 394 | en, 395 | Base, 396 | ); 397 | mainGroup = 83CBB9F61A601CBA00E9B192; 398 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 399 | projectDirPath = ""; 400 | projectReferences = ( 401 | { 402 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 403 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 404 | }, 405 | { 406 | ProductGroup = 1479F8411B6934390043A101 /* Products */; 407 | ProjectRef = 1479F8401B6934390043A101 /* RCTAddressBook.xcodeproj */; 408 | }, 409 | { 410 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 411 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 412 | }, 413 | { 414 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 415 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 416 | }, 417 | { 418 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 419 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 420 | }, 421 | { 422 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 423 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 424 | }, 425 | { 426 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 427 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 428 | }, 429 | { 430 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 431 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 432 | }, 433 | { 434 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 435 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 436 | }, 437 | { 438 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 439 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 440 | }, 441 | { 442 | ProductGroup = 146834001AC3E56700842450 /* Products */; 443 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 444 | }, 445 | ); 446 | projectRoot = ""; 447 | targets = ( 448 | 13B07F861A680F5B00A75B9A /* AddressbookDemo */, 449 | 00E356ED1AD99517003FC87E /* AddressbookDemoTests */, 450 | ); 451 | }; 452 | /* End PBXProject section */ 453 | 454 | /* Begin PBXReferenceProxy section */ 455 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 456 | isa = PBXReferenceProxy; 457 | fileType = archive.ar; 458 | path = libRCTActionSheet.a; 459 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 460 | sourceTree = BUILT_PRODUCTS_DIR; 461 | }; 462 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 463 | isa = PBXReferenceProxy; 464 | fileType = archive.ar; 465 | path = libRCTGeolocation.a; 466 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 467 | sourceTree = BUILT_PRODUCTS_DIR; 468 | }; 469 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 470 | isa = PBXReferenceProxy; 471 | fileType = archive.ar; 472 | path = libRCTImage.a; 473 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 474 | sourceTree = BUILT_PRODUCTS_DIR; 475 | }; 476 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 477 | isa = PBXReferenceProxy; 478 | fileType = archive.ar; 479 | path = libRCTNetwork.a; 480 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 481 | sourceTree = BUILT_PRODUCTS_DIR; 482 | }; 483 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 484 | isa = PBXReferenceProxy; 485 | fileType = archive.ar; 486 | path = libRCTVibration.a; 487 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 488 | sourceTree = BUILT_PRODUCTS_DIR; 489 | }; 490 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 491 | isa = PBXReferenceProxy; 492 | fileType = archive.ar; 493 | path = libRCTSettings.a; 494 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 495 | sourceTree = BUILT_PRODUCTS_DIR; 496 | }; 497 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 498 | isa = PBXReferenceProxy; 499 | fileType = archive.ar; 500 | path = libRCTWebSocket.a; 501 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 502 | sourceTree = BUILT_PRODUCTS_DIR; 503 | }; 504 | 146834041AC3E56700842450 /* libReact.a */ = { 505 | isa = PBXReferenceProxy; 506 | fileType = archive.ar; 507 | path = libReact.a; 508 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 509 | sourceTree = BUILT_PRODUCTS_DIR; 510 | }; 511 | 1479F8471B6934390043A101 /* libRCTAddressBook.a */ = { 512 | isa = PBXReferenceProxy; 513 | fileType = archive.ar; 514 | path = libRCTAddressBook.a; 515 | remoteRef = 1479F8461B6934390043A101 /* PBXContainerItemProxy */; 516 | sourceTree = BUILT_PRODUCTS_DIR; 517 | }; 518 | 1479F8491B6934390043A101 /* RCTAddressBookTests.xctest */ = { 519 | isa = PBXReferenceProxy; 520 | fileType = wrapper.cfbundle; 521 | path = RCTAddressBookTests.xctest; 522 | remoteRef = 1479F8481B6934390043A101 /* PBXContainerItemProxy */; 523 | sourceTree = BUILT_PRODUCTS_DIR; 524 | }; 525 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 526 | isa = PBXReferenceProxy; 527 | fileType = archive.ar; 528 | path = libRCTLinking.a; 529 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 530 | sourceTree = BUILT_PRODUCTS_DIR; 531 | }; 532 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 533 | isa = PBXReferenceProxy; 534 | fileType = archive.ar; 535 | path = libRCTText.a; 536 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 537 | sourceTree = BUILT_PRODUCTS_DIR; 538 | }; 539 | /* End PBXReferenceProxy section */ 540 | 541 | /* Begin PBXResourcesBuildPhase section */ 542 | 00E356EC1AD99517003FC87E /* Resources */ = { 543 | isa = PBXResourcesBuildPhase; 544 | buildActionMask = 2147483647; 545 | files = ( 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 550 | isa = PBXResourcesBuildPhase; 551 | buildActionMask = 2147483647; 552 | files = ( 553 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, 554 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 555 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 556 | ); 557 | runOnlyForDeploymentPostprocessing = 0; 558 | }; 559 | /* End PBXResourcesBuildPhase section */ 560 | 561 | /* Begin PBXSourcesBuildPhase section */ 562 | 00E356EA1AD99517003FC87E /* Sources */ = { 563 | isa = PBXSourcesBuildPhase; 564 | buildActionMask = 2147483647; 565 | files = ( 566 | 00E356F31AD99517003FC87E /* AddressbookDemoTests.m in Sources */, 567 | ); 568 | runOnlyForDeploymentPostprocessing = 0; 569 | }; 570 | 13B07F871A680F5B00A75B9A /* Sources */ = { 571 | isa = PBXSourcesBuildPhase; 572 | buildActionMask = 2147483647; 573 | files = ( 574 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 575 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 576 | ); 577 | runOnlyForDeploymentPostprocessing = 0; 578 | }; 579 | /* End PBXSourcesBuildPhase section */ 580 | 581 | /* Begin PBXTargetDependency section */ 582 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 583 | isa = PBXTargetDependency; 584 | target = 13B07F861A680F5B00A75B9A /* AddressbookDemo */; 585 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 586 | }; 587 | /* End PBXTargetDependency section */ 588 | 589 | /* Begin PBXVariantGroup section */ 590 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 591 | isa = PBXVariantGroup; 592 | children = ( 593 | 13B07FB21A68108700A75B9A /* Base */, 594 | ); 595 | name = LaunchScreen.xib; 596 | path = iOS; 597 | sourceTree = ""; 598 | }; 599 | /* End PBXVariantGroup section */ 600 | 601 | /* Begin XCBuildConfiguration section */ 602 | 00E356F61AD99517003FC87E /* Debug */ = { 603 | isa = XCBuildConfiguration; 604 | buildSettings = { 605 | BUNDLE_LOADER = "$(TEST_HOST)"; 606 | FRAMEWORK_SEARCH_PATHS = ( 607 | "$(SDKROOT)/Developer/Library/Frameworks", 608 | "$(inherited)", 609 | ); 610 | GCC_PREPROCESSOR_DEFINITIONS = ( 611 | "DEBUG=1", 612 | "$(inherited)", 613 | ); 614 | INFOPLIST_FILE = AddressbookDemoTests/Info.plist; 615 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 616 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 617 | PRODUCT_NAME = "$(TARGET_NAME)"; 618 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AddressbookDemo.app/AddressbookDemo"; 619 | }; 620 | name = Debug; 621 | }; 622 | 00E356F71AD99517003FC87E /* Release */ = { 623 | isa = XCBuildConfiguration; 624 | buildSettings = { 625 | BUNDLE_LOADER = "$(TEST_HOST)"; 626 | COPY_PHASE_STRIP = NO; 627 | FRAMEWORK_SEARCH_PATHS = ( 628 | "$(SDKROOT)/Developer/Library/Frameworks", 629 | "$(inherited)", 630 | ); 631 | INFOPLIST_FILE = AddressbookDemoTests/Info.plist; 632 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 633 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 634 | PRODUCT_NAME = "$(TARGET_NAME)"; 635 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AddressbookDemo.app/AddressbookDemo"; 636 | }; 637 | name = Release; 638 | }; 639 | 13B07F941A680F5B00A75B9A /* Debug */ = { 640 | isa = XCBuildConfiguration; 641 | buildSettings = { 642 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 643 | HEADER_SEARCH_PATHS = ( 644 | "$(inherited)", 645 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 646 | "$(SRCROOT)/node_modules/react-native/React/**", 647 | ); 648 | INFOPLIST_FILE = iOS/Info.plist; 649 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 650 | OTHER_LDFLAGS = "-ObjC"; 651 | PRODUCT_NAME = AddressbookDemo; 652 | }; 653 | name = Debug; 654 | }; 655 | 13B07F951A680F5B00A75B9A /* Release */ = { 656 | isa = XCBuildConfiguration; 657 | buildSettings = { 658 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 659 | HEADER_SEARCH_PATHS = ( 660 | "$(inherited)", 661 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 662 | "$(SRCROOT)/node_modules/react-native/React/**", 663 | ); 664 | INFOPLIST_FILE = iOS/Info.plist; 665 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 666 | OTHER_LDFLAGS = "-ObjC"; 667 | PRODUCT_NAME = AddressbookDemo; 668 | }; 669 | name = Release; 670 | }; 671 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 672 | isa = XCBuildConfiguration; 673 | buildSettings = { 674 | ALWAYS_SEARCH_USER_PATHS = NO; 675 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 676 | CLANG_CXX_LIBRARY = "libc++"; 677 | CLANG_ENABLE_MODULES = YES; 678 | CLANG_ENABLE_OBJC_ARC = YES; 679 | CLANG_WARN_BOOL_CONVERSION = YES; 680 | CLANG_WARN_CONSTANT_CONVERSION = YES; 681 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 682 | CLANG_WARN_EMPTY_BODY = YES; 683 | CLANG_WARN_ENUM_CONVERSION = YES; 684 | CLANG_WARN_INT_CONVERSION = YES; 685 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 686 | CLANG_WARN_UNREACHABLE_CODE = YES; 687 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 688 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 689 | COPY_PHASE_STRIP = NO; 690 | ENABLE_STRICT_OBJC_MSGSEND = YES; 691 | GCC_C_LANGUAGE_STANDARD = gnu99; 692 | GCC_DYNAMIC_NO_PIC = NO; 693 | GCC_OPTIMIZATION_LEVEL = 0; 694 | GCC_PREPROCESSOR_DEFINITIONS = ( 695 | "DEBUG=1", 696 | "$(inherited)", 697 | ); 698 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 699 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 700 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 701 | GCC_WARN_UNDECLARED_SELECTOR = YES; 702 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 703 | GCC_WARN_UNUSED_FUNCTION = YES; 704 | GCC_WARN_UNUSED_VARIABLE = YES; 705 | HEADER_SEARCH_PATHS = ( 706 | "$(inherited)", 707 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 708 | "$(SRCROOT)/node_modules/react-native/React/**", 709 | ); 710 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 711 | MTL_ENABLE_DEBUG_INFO = YES; 712 | ONLY_ACTIVE_ARCH = YES; 713 | SDKROOT = iphoneos; 714 | }; 715 | name = Debug; 716 | }; 717 | 83CBBA211A601CBA00E9B192 /* Release */ = { 718 | isa = XCBuildConfiguration; 719 | buildSettings = { 720 | ALWAYS_SEARCH_USER_PATHS = NO; 721 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 722 | CLANG_CXX_LIBRARY = "libc++"; 723 | CLANG_ENABLE_MODULES = YES; 724 | CLANG_ENABLE_OBJC_ARC = YES; 725 | CLANG_WARN_BOOL_CONVERSION = YES; 726 | CLANG_WARN_CONSTANT_CONVERSION = YES; 727 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 728 | CLANG_WARN_EMPTY_BODY = YES; 729 | CLANG_WARN_ENUM_CONVERSION = YES; 730 | CLANG_WARN_INT_CONVERSION = YES; 731 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 732 | CLANG_WARN_UNREACHABLE_CODE = YES; 733 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 734 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 735 | COPY_PHASE_STRIP = YES; 736 | ENABLE_NS_ASSERTIONS = NO; 737 | ENABLE_STRICT_OBJC_MSGSEND = YES; 738 | GCC_C_LANGUAGE_STANDARD = gnu99; 739 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 740 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 741 | GCC_WARN_UNDECLARED_SELECTOR = YES; 742 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 743 | GCC_WARN_UNUSED_FUNCTION = YES; 744 | GCC_WARN_UNUSED_VARIABLE = YES; 745 | HEADER_SEARCH_PATHS = ( 746 | "$(inherited)", 747 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 748 | "$(SRCROOT)/node_modules/react-native/React/**", 749 | ); 750 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 751 | MTL_ENABLE_DEBUG_INFO = NO; 752 | SDKROOT = iphoneos; 753 | VALIDATE_PRODUCT = YES; 754 | }; 755 | name = Release; 756 | }; 757 | /* End XCBuildConfiguration section */ 758 | 759 | /* Begin XCConfigurationList section */ 760 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AddressbookDemoTests" */ = { 761 | isa = XCConfigurationList; 762 | buildConfigurations = ( 763 | 00E356F61AD99517003FC87E /* Debug */, 764 | 00E356F71AD99517003FC87E /* Release */, 765 | ); 766 | defaultConfigurationIsVisible = 0; 767 | defaultConfigurationName = Release; 768 | }; 769 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AddressbookDemo" */ = { 770 | isa = XCConfigurationList; 771 | buildConfigurations = ( 772 | 13B07F941A680F5B00A75B9A /* Debug */, 773 | 13B07F951A680F5B00A75B9A /* Release */, 774 | ); 775 | defaultConfigurationIsVisible = 0; 776 | defaultConfigurationName = Release; 777 | }; 778 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AddressbookDemo" */ = { 779 | isa = XCConfigurationList; 780 | buildConfigurations = ( 781 | 83CBBA201A601CBA00E9B192 /* Debug */, 782 | 83CBBA211A601CBA00E9B192 /* Release */, 783 | ); 784 | defaultConfigurationIsVisible = 0; 785 | defaultConfigurationName = Release; 786 | }; 787 | /* End XCConfigurationList section */ 788 | }; 789 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 790 | } 791 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/AddressbookDemo.xcodeproj/xcshareddata/xcschemes/AddressbookDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/AddressbookDemoTests/AddressbookDemoTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTAssert.h" 14 | #import "RCTRedBox.h" 15 | #import "RCTRootView.h" 16 | 17 | #define TIMEOUT_SECONDS 240 18 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 19 | 20 | @interface AddressbookDemoTests : XCTestCase 21 | 22 | @end 23 | 24 | @implementation AddressbookDemoTests 25 | 26 | 27 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 28 | { 29 | if (test(view)) { 30 | return YES; 31 | } 32 | for (UIView *subview in [view subviews]) { 33 | if ([self findSubviewInView:subview matching:test]) { 34 | return YES; 35 | } 36 | } 37 | return NO; 38 | } 39 | 40 | - (void)testRendersWelcomeScreen { 41 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 42 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 43 | BOOL foundElement = NO; 44 | NSString *redboxError = nil; 45 | 46 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 47 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 49 | 50 | redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; 51 | 52 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 53 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 54 | return YES; 55 | } 56 | return NO; 57 | }]; 58 | } 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/AddressbookDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/components/ContactList.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native') 2 | var {Text, ScrollView, View} = React 3 | 4 | module.exports = React.createClass({ 5 | render(){ 6 | if(this.props.contacts.lengh === 0){ 7 | return No Contacts Loaded... 8 | } 9 | return ( 10 | 11 | {this.props.contacts.map((contact) => { 12 | return ( 13 | 14 | {contact.recordID} - {contact.firstName} - {contact.lastName} 15 | {JSON.stringify(contact.emailAddresses)} 16 | 17 | ) 18 | })} 19 | 20 | ) 21 | } 22 | }) 23 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | /** 21 | * Loading JavaScript code - uncomment the one you want. 22 | * 23 | * OPTION 1 24 | * Load from development server. Start the server from the repository root: 25 | * 26 | * $ npm start 27 | * 28 | * To run on device, change `localhost` to the IP address of your computer 29 | * (you can get this by typing `ifconfig` into the terminal and selecting the 30 | * `inet` value under `en0:`) and make sure your computer and iOS device are 31 | * on the same Wi-Fi network. 32 | */ 33 | 34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. To re-generate the static bundle 39 | * from the root of your project directory, run 40 | * 41 | * $ react-native bundle --minify 42 | * 43 | * see http://facebook.github.io/react-native/docs/runningondevice.html 44 | */ 45 | 46 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 47 | 48 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 49 | moduleName:@"AddressbookDemo" 50 | launchOptions:launchOptions]; 51 | 52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 53 | UIViewController *rootViewController = [[UIViewController alloc] init]; 54 | rootViewController.view = rootView; 55 | self.window.rootViewController = rootViewController; 56 | [self.window makeKeyAndVisible]; 57 | return YES; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/main.jsbundle: -------------------------------------------------------------------------------- 1 | // Offline JS 2 | // To re-generate the offline bundle, run this from the root of your project: 3 | // 4 | // $ react-native bundle --minify 5 | // 6 | // See http://facebook.github.io/react-native/docs/runningondevice.html for more details. 7 | 8 | throw new Error('Offline JS file is empty. See iOS/main.jsbundle for instructions'); 9 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/iOS/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/index.ios.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native'); 2 | var { AppRegistry, StyleSheet, Text, View, ScrollView, TouchableHighlight } = React; 3 | var ContactList = require('./components/ContactList') 4 | var AddressBook = require('react-native-addressbook') 5 | 6 | var AddressbookDemo = React.createClass({ 7 | getInitialState() { 8 | return { 9 | contacts: [], 10 | } 11 | }, 12 | 13 | loadContacts(){ 14 | AddressBook.getContacts( (err, contacts) => { 15 | console.log('GET CONTACTS', err, contacts) 16 | if(err && err.type === 'permissionDenied'){ 17 | // x.x 18 | } 19 | else{ 20 | this.setState({contacts: contacts}) 21 | } 22 | }) 23 | }, 24 | 25 | newContact(){ 26 | var newPerson = { 27 | lastName: "Nietzsche", 28 | firstName: "Friedrich", 29 | emailAddresses: [{ 30 | label: "work", 31 | email: "mrniet@example.com", 32 | }], 33 | } 34 | 35 | AddressBook.addContact(newPerson, (err) => { 36 | console.log('NEW CONTACT', err, newPerson) 37 | }) 38 | }, 39 | 40 | updateContact(){ 41 | let firstContact = this.state.contacts[0] 42 | firstContact.emailAddresses.push({ 43 | label: "junk"+Math.round(Math.random()*100), 44 | email: "mrniet+"+Math.round(Math.random()*100)+"@test.com", 45 | }) 46 | AddressBook.updateContact(firstContact, (err) => { 47 | console.log('UPDATE CONTACT', err, firstContact) 48 | }) 49 | }, 50 | 51 | deleteContact(){ 52 | let firstContact = this.state.contacts[0] 53 | AddressBook.deleteContact(firstContact, (err) => { 54 | console.log('DELETE CONTACT', err) 55 | }) 56 | }, 57 | 58 | requestPermissions(){ 59 | AddressBook.requestPermission( (err, permission) => { 60 | console.log('REQUEST PERMISSION', err, permission) 61 | }) 62 | }, 63 | 64 | checkPermission(){ 65 | AddressBook.checkPermission( (err, permission) => { 66 | console.log('CHECK PERMISSION', err, permission) 67 | }) 68 | }, 69 | 70 | render: function() { 71 | return ( 72 | 73 | 74 | all actions are console.logged 75 | 76 | 77 | Load Contacts 78 | 79 | 80 | Create Contact 81 | 82 | 83 | Update Contact 84 | 85 | 86 | Delete Contact 87 | 88 | 89 | Request Permissions 90 | 91 | 92 | Check Permissions 93 | 94 | 95 | 96 | 97 | ); 98 | } 99 | }); 100 | 101 | var styles = StyleSheet.create({ 102 | container: { 103 | flex: 1, 104 | padding:10, 105 | justifyContent: 'center', 106 | backgroundColor: 'rgba(255,255,255,1)', 107 | }, 108 | note: { 109 | fontSize:20, 110 | fontWeight:'bold', 111 | }, 112 | button: { 113 | backgroundColor: 'rgba(0,0,0,.6)', 114 | padding:5, 115 | borderRadius:3, 116 | borderWidth:1, 117 | margin: 5, 118 | borderColor: 'rgba(0,0,0,.8)' 119 | }, 120 | instructions: { 121 | color: '#333333', 122 | marginBottom: 5, 123 | }, 124 | }); 125 | 126 | AppRegistry.registerComponent('AddressbookDemo', () => AddressbookDemo); 127 | -------------------------------------------------------------------------------- /examples/AddressbookDemo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AddressbookDemo", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node_modules/react-native/packager/packager.sh" 7 | }, 8 | "dependencies": { 9 | "react-native": "^0.8.0", 10 | "react-native-addressbook": "^1.1.5" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('react-native').NativeModules.AddressBook 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-addressbook", 3 | "repository": { 4 | "type": "git", 5 | "url": "https://github.com/rt2zz/react-native-addressbook.git" 6 | }, 7 | "version": "1.2.0", 8 | "description": "AddressBook module for react-native", 9 | "keywords": [ 10 | "react-native", 11 | "react", 12 | "react-component", 13 | "addressbook", 14 | "contacts" 15 | ], 16 | "bugs": { 17 | "url": "https://github.com/rt2zz/react-native-addressbook/issues" 18 | }, 19 | "homepage": "https://github.com/rt2zz/react-native-addressbook", 20 | "main": "index.js", 21 | "scripts": { 22 | "test": "echo \"Error: no test specified\" && exit 1" 23 | }, 24 | "author": "rt2zz ", 25 | "license": "MIT" 26 | } 27 | --------------------------------------------------------------------------------