Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.5 KB

Linking.md

File metadata and controls

60 lines (42 loc) · 1.5 KB

Manual Linking

iOS

Project linking

  1. Open your project .xcodeproj on xcode.

  2. Right click on the Libraries folder and select Add files to "yourProjectName".

  3. Add RNCAsyncStorage.xcodeproj (located at node_modules/@react-native-community/async-storage/ios) to your project Libraries.

  4. Go to Build Phases -> Link Binary with Libraries and add: libRNCAsyncStorage.a.

Using 'Pods'

  1. Enter into iOS Folder cd ios/ (on your project's root folder).

  2. Add this line to your Podfile just below the last pod (if you don't have one, you can create it by running pod init):

+ pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  1. Run pod install

Android

  1. Add project to android/settings.gradle:
rootProject.name = 'MyApp'

include ':app'

+ include ':@react-native-community_async-storage'
+ project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
  1. In android/app/build.gradle add to dependencies:
dependencies {
  ...
+ implementation project(':@react-native-community_async-storage')
}
  1. Then, in MainApplication.java:
package com.myapp;

+ import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;

...

@Override
protected List<ReactPackage> getPackages() {
    return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
+       new AsyncStoragePackage()
    );
}