Skip to content

Commit f125509

Browse files
Merge pull request #33 from predatorx7/main
Update In-App react native sdk's documentation
2 parents a280df1 + 69fb89d commit f125509

File tree

4 files changed

+920
-612
lines changed

4 files changed

+920
-612
lines changed

content/docs/inapp-sdks/react-native.mdx

+72-38
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,33 @@ title: React Native SDK
33
description: This SDK allows you to integrate Reclaim's in-app verification process into your React Native application.
44
---
55

6+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
7+
68
## Prerequisites
79

810
- A [Reclaim account](https://dev.reclaimprotocol.org/explore) where you've created an app and have the app id, app secret.
911
- A provider id that you've added to your app in [Reclaim Devtools](https://dev.reclaimprotocol.org/explore).
1012

13+
Note:
14+
- This SDK may not be compatible with React Native [Frameworks](https://reactnative.dev/architecture/glossary#react-native-framework) like Expo.
15+
- To learn more about React Native apps without a framework, refer to the [React Native documentation](https://reactnative.dev/docs/getting-started-without-a-framework).
16+
1117
## Example
1218

13-
- See the [Reclaim Example - React Native](example/README.md) for a complete example of how to use the SDK in a React Native application.
19+
- See the [Reclaim Example - React Native](https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk/tree/main/example) for a complete example of how to use the SDK in a React Native application.
1420

1521
## Installation
1622

17-
```sh
23+
```package-install
1824
npm install @reclaimprotocol/inapp-rn-sdk
1925
```
2026

21-
Note: This package is not published to npm registry. Will be published soon. For now, you can install it from git source.
22-
23-
### Install from git source (alternative)
27+
#### Alternative: Install from git source
2428

25-
#### NPM
26-
27-
```sh
29+
```package-install
2830
npm install git+https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git
2931
```
3032

31-
#### Yarn
32-
33-
```sh
34-
yarn add git+https://github.com/reclaimprotocol/reclaim-inapp-reactnative-sdk.git
35-
```
36-
3733
## Setup
3834

3935
### Android Setup
@@ -52,7 +48,8 @@ Add the following to your `android/app/src/main/AndroidManifest.xml` file under
5248

5349
add the following to the end of settings.gradle:
5450

55-
```groovy
51+
<Tabs items={['Groovy', 'Kotlin']}>
52+
```groovy tabs="Groovy"
5653
dependencyResolutionManagement {
5754
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
5855
String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
@@ -70,12 +67,30 @@ dependencyResolutionManagement {
7067
}
7168
```
7269

73-
(Ignore if already added in settings.gradle from above)
70+
```kotlin tabs="Kotlin"
71+
dependencyResolutionManagement {
72+
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
73+
val flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
74+
val reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
75+
repositories {
76+
google()
77+
mavenCentral()
78+
maven("$reclaimStorageUrl")
79+
maven("$flutterStorageUrl/download.flutter.io")
80+
}
81+
}
82+
```
83+
</Tabs>
84+
85+
(Ignore if already added in `settings.gradle` from above)
7486
or alternatively add the following repositories to the relevant repositories block:
7587

76-
```groovy
88+
89+
<Tabs items={['Groovy', 'Kotlin']}>
90+
```groovy tabs="Groovy"
7791
String flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
7892
String reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
93+
// ...
7994
maven {
8095
url "$reclaimStorageUrl"
8196
}
@@ -84,42 +99,54 @@ maven {
8499
}
85100
```
86101

87-
Some projects may require you to add the repositories to the root `build.gradle` file or your app-level `build.gradle` file's allprojects section.
102+
```kotlin tabs="Kotlin"
103+
val flutterStorageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
104+
val reclaimStorageUrl = System.env.RECLAIM_STORAGE_BASE_URL ?: "https://reclaim-inapp-sdk.s3.ap-south-1.amazonaws.com/android/0.1.2/repo"
105+
// ...
106+
maven("$reclaimStorageUrl")
107+
maven("$flutterStorageUrl/download.flutter.io")
108+
```
109+
</Tabs>
88110

89111
### iOS Setup
90112

91-
1. Make sure to define a global platform for your project in your `Podfile` with version 13.0 or higher.
113+
1. Make sure to have a platform declaration for your project in your `Podfile` with version 13.0 or higher.
92114

115+
```ruby
116+
platform :ios, '13.0' # or platform :ios, min_ios_version_supported
93117
```
94-
platform :ios, '13.0'
95-
```
96-
2. Add the following to your `Podfile`:
97118

98-
- From a specific tag (recommended):
119+
Ignore if you already have this declaration in your `Podfile`.
99120

100-
```ruby
101-
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.1.2'
102-
```
121+
2. Add the following to your `Podfile` to override SDK dependency:
103122

104-
- or from git HEAD (Alternative):
123+
- You can override the version of dependency when you wish to use a specific version of the SDK.
124+
- You can add a declaration in your `Podfile` to install the SDK from cocoapods, or from a specific git tag, head, commit, or branch.
105125

106-
```ruby
107-
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git'
126+
<Tabs items={['Cocoapods (Recommended)', 'Git Tag', 'Git Head', 'Git Commit', 'Git Branch']}>
127+
```ruby tabs="Cocoapods (Recommended)"
128+
# Cocoapods is the recommended way to install the SDK.
129+
pod 'ReclaimInAppSdk', '~> 0.1.4'
108130
```
109131

110-
- or from a specific commit (Alternative):
132+
```ruby tabs="Git Tag"
133+
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.1.4'
134+
```
111135

112-
```ruby
113-
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :commit => '184d41628026768feb703dc7bb9a3d913c6b271e'
136+
```ruby tabs="Git Head"
137+
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git'
114138
```
115139

116-
- or from a specific branch (Alternative):
140+
```ruby tabs="Git Commit"
141+
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :commit => 'a488eaa2279318f4836ead105e5ecce6fb6a0481'
142+
```
117143

118-
```ruby
144+
```ruby tabs="Git Branch"
119145
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :branch => 'main'
120146
```
147+
</Tabs>
121148

122-
2. After adding the dependency, your podfile may look like this:
149+
- After adding the dependency, your podfile may look like this:
123150

124151
```ruby
125152
platform :ios, '13.0'
@@ -135,7 +162,7 @@ target 'InappRnSdkExample' do
135162
)
136163

137164
# This is the line you need to add to your podfile.
138-
pod 'ReclaimInAppSdk', :git => 'https://github.com/reclaimprotocol/reclaim-inapp-ios-sdk.git', :tag => '0.1.2'
165+
pod 'ReclaimInAppSdk', '~> 0.1.4'
139166

140167
pre_install do |installer|
141168
system("cd ../../ && npx bob build --target codegen")
@@ -144,11 +171,18 @@ target 'InappRnSdkExample' do
144171
# ... rest of the podfile. (removed for brevity)
145172
```
146173

174+
3. Run `pod install` inside the ios/ directory of your project.
175+
176+
```bash
177+
cd ios/
178+
pod install
179+
```
180+
147181
#### Fixing performance issues on IOS physical devices
148182

149183
Your app performance will be severely impacted when you run debug executable on a physical device. Fixing this requires a simple change in your Xcode project xcscheme.
150184

151-
#### Method 1: Update Environment Variables for XCScheme (Recommended)
185+
##### Method 1: Update Environment Variables for XCScheme (Recommended)
152186
1. Open your iOS project (*.xcworkspace) in Xcode.
153187
2. Click on the project target.
154188
3. Click on the **Scheme** dropdown.
@@ -167,7 +201,7 @@ Your app performance will be severely impacted when you run debug executable on
167201
8. Click on the **Close** button in the dialog and build the project.
168202
9. Run the app on a physical device.
169203

170-
#### Method 2: Disable "Debug executable"
204+
##### Method 2: Disable "Debug executable"
171205

172206
This method is **not recommended** but could be useful if you don't want to add environment variables to the xcscheme.
173207

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@theguild/remark-mermaid": "^0.2.0",
1717
"@vercel/analytics": "^1.4.1",
1818
"fumadocs-core": "14.6.1",
19+
"fumadocs-docgen": "^1.3.7",
1920
"fumadocs-mdx": "11.1.2",
2021
"fumadocs-ui": "14.6.1",
2122
"lucide-react": "^0.469.0",

0 commit comments

Comments
 (0)