Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
trunges21 committed Mar 24, 2023
1 parent 77306bf commit 0daa740
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 9 deletions.
85 changes: 82 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,75 @@ Follow [the installation instructions for your chosen OS](https://reactnative.de

## Installation

#### npm

The SDK can be installed with `npm` or `yarn` but we will use `npm` for code samples.

```shell
npm install @kinde-oss/react-native-sdk --save
```

For iOS, you need to updating iOS native dependencies by **CocoaPods**. We recommend installing **CocoaPods** using [Homebrew](https://brew.sh/)
### Android
Checking `MainApplication.java` to verify the `react-native-keychain` was added. If not, you need to install manually:

- Edit `android/settings.gradle`
```java
...

include ':react-native-keychain'
project(':react-native-keychain').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keychain/android')

...
```
- Edit `android/app/build.gradle`
```java
apply plugin: 'com.android.application'

android {
...
}

dependencies {
...

implementation project(':react-native-keychain')

...
}
```

- Edit your `MainApplication.java`
```java
...

import com.oblador.keychain.KeychainPackage;

...

public class MainActivity extends extends ReactActivity {
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new KeychainPackage()
);
}

// or
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new KeychainPackage());
return packages;
}
...
}
...
```

#### iOS

You need to updating iOS native dependencies by **CocoaPods**. We recommend installing **CocoaPods** using [Homebrew](https://brew.sh/)

```shell
# Install CocoaPods via brew
Expand All @@ -39,6 +99,25 @@ brew install cocoapods
cd ios && pod install
```

If the `react-native-keychain` not linked, you need to install manually
##### Option: With CocoaPods (High recommended)

Add the following to your `Podfile` and run pod update:
```Swift
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
```

##### Option: Manually
- Click to `Build Phases` tab
- Choose `Link Binary With Libraries`
- Click `+` in bottom
- **Add Other...** => **Add Files...** => **node_modules/react-native-keychain/RNKeychain.xcodeproj**
- Then, you need to add `libRNKeychain.a`
- Clean and rebuild

##### Enable `Keychain Sharing` entitlement for iOS 10+
For iOS 10 you'll need to enable the `Keychain Sharing` entitlement in the `Capabilities` section of your build target
![screenshot](./assets/image.png)
## Getting Started

### Kinde configuration
Expand Down
1 change: 0 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ dependencies {
compile "com.android.support:appcompat-v7:23.0.1"
compile 'com.android.support:support-annotations:22.2.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-keychain')
}

// Run this once to be able to run the application with BUCK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public boolean getUseDeveloperSupport() {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new KeychainPackage()
new MainReactPackage()
);
}

Expand Down
3 changes: 0 additions & 3 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
rootProject.name = 'KindeSDKRN'

include ':app'

include ':react-native-keychain'
project(':react-native-keychain').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-keychain/android')
Binary file added assets/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0daa740

Please sign in to comment.