Skip to content

added react-native-get-random-values package #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d

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

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

```
Expand All @@ -91,6 +94,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d

implementation project(':react-native-keychain')
implementation project(':react-native-inappbrowser-reborn')
implementation project(':react-native-get-random-values')

...
}
Expand All @@ -103,6 +107,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d
...
import com.oblador.keychain.KeychainPackage;
import com.proyecto26.inappbrowser.RNInAppBrowserPackage;
import org.linusu.RNGetRandomValuesPackage;
...

public class MainApplication extends Application implements ReactApplication {
Expand All @@ -115,6 +120,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new KeychainPackage());
packages.add(new RNInAppBrowserPackage());
packages.add(new RNGetRandomValuesPackage());
...
return packages;
}
Expand All @@ -132,6 +138,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d
```kotlin
import com.oblador.keychain.KeychainPackage;
import com.proyecto26.inappbrowser.RNInAppBrowserPackage;
import org.linusu.RNGetRandomValuesPackage;
...

class MainApplication : Application(), ReactApplication {
Expand All @@ -143,6 +150,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d
// add(MyReactNativePackage())
add(KeychainPackage());
add(RNInAppBrowserPackage());
add(RNGetRandomValuesPackage());
}

...
Expand Down Expand Up @@ -178,6 +186,7 @@ Follow [the installation instructions for your chosen OS](https://reactnative.d
```swift
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
pod 'RNInAppBrowser', :path => '../node_modules/react-native-inappbrowser-reborn'
pod 'react-native-get-random-values', :path => '../node_modules/react-native-get-random-values'

```

Expand Down
17 changes: 13 additions & 4 deletions src/content/docs/developer-tools/sdks/native/react-native-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Fundamentally, both SDK versions have equivalent functionality, so there should

### **Android**

The SDK requires the `react-native-keychain` and `react-native-inappbrowser-reborn` packages. Sometimes, they may not be automatically linked correctly, resulting in errors when running your app, such as `"Cannot read properties of undefined (reading 'isAvailable')"`. In such cases, you will need to manually link them:
The SDK requires the `react-native-keychain`, `react-native-inappbrowser-reborn` and `react-native-get-random-values` packages. Sometimes, they may not be automatically linked correctly, resulting in errors when running your app, such as `"Cannot read properties of undefined (reading 'isAvailable')"`. In such cases, you will need to manually link them:

1. Edit `android/settings.gradle`

Expand All @@ -72,6 +72,9 @@ The SDK requires the `react-native-keychain` and `react-native-inappbrowser-rebo

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

include ':react-native-get-random-values'
project(':react-native-get-random-values').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-random-values/android')
```

2. Edit `android/app/build.gradle`
Expand All @@ -88,6 +91,7 @@ The SDK requires the `react-native-keychain` and `react-native-inappbrowser-rebo

implementation project(':react-native-keychain')
implementation project(':react-native-inappbrowser-reborn')
implementation project(':react-native-get-random-values')

...
}
Expand All @@ -98,6 +102,7 @@ The SDK requires the `react-native-keychain` and `react-native-inappbrowser-rebo
```java
import com.oblador.keychain.KeychainPackage;
import com.proyecto26.inappbrowser.RNInAppBrowserPackage;
import org.linusu.RNGetRandomValuesPackage;
...

public class MainApplication extends Application implements ReactApplication {
Expand All @@ -110,6 +115,7 @@ The SDK requires the `react-native-keychain` and `react-native-inappbrowser-rebo
List<ReactPackage> packages = new PackageList(this).getPackages();
packages.add(new KeychainPackage());
packages.add(new RNInAppBrowserPackage());
packages.add(new RNGetRandomValuesPackage());
...
return packages;
}
Expand All @@ -125,6 +131,7 @@ In React Native version 0.73 or above, the `MainApplication.java` file has been
```kotlin
import com.oblador.keychain.KeychainPackage;
import com.proyecto26.inappbrowser.RNInAppBrowserPackage;
import org.linusu.RNGetRandomValuesPackage;
...

class MainApplication : Application(), ReactApplication {
Expand All @@ -136,6 +143,7 @@ class MainApplication : Application(), ReactApplication {
// add(MyReactNativePackage())
add(KeychainPackage());
add(RNInAppBrowserPackage());
add(RNGetRandomValuesPackage());
}

...
Expand All @@ -155,7 +163,7 @@ brew install cocoapods
cd ios && pod install
```

The SDK requires the `react-native-keychain` and `react-native-inappbrowser-reborn` packages. Sometimes, they may not be automatically linked correctly, resulting in errors when running your app, such as `"Cannot read properties of undefined (reading 'isAvailable')"`. In such cases, you will need to manually link them:
The SDK requires the `react-native-keychain`, `react-native-inappbrowser-reborn` and `react-native-get-random-values` packages. Sometimes, they may not be automatically linked correctly, resulting in errors when running your app, such as `"Cannot read properties of undefined (reading 'isAvailable')"`. In such cases, you will need to manually link them:

1. **Option: With CocoaPods (Highly recommended)**

Expand All @@ -164,13 +172,14 @@ The SDK requires the `react-native-keychain` and `react-native-inappbrowser-rebo
```swift
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
pod 'RNInAppBrowser', :path => '../node_modules/react-native-inappbrowser-reborn'
pod 'react-native-get-random-values', :path => '../node_modules/react-native-get-random-values'
```

2. **Option: Manually link the packages with Xcode**
- Go to the **Build Phases** tab and choose **Link Binary With Libraries.**
- Select **+**
- Add **Other** > **Add Files** > **node_modules/react-native-keychain/RNKeychain.xcodeproj** (similar with **RNInAppBrowser**)
- Add **libRNKeychain.a** (similar with **RNInAppBrowser**)
- Add **Other** > **Add Files** > **node_modules/react-native-keychain/RNKeychain.xcodeproj** (similar with **RNInAppBrowser** and **react-native-get-random-values**)
- Add **libRNKeychain.a** (similar with **RNInAppBrowser** and **react-native-get-random-values**)
- Clean and rebuild.

If you encounter any errors during the SDK installation process, you can refer to the General Tips section at the end of this topic.
Expand Down