Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 416fe1c

Browse files
authored
🏷️ Release / v1.0.0 (#20)
* update version number to 1.0.0 * improve expo config in README file
1 parent 26fc93b commit 416fe1c

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed

Diff for: README.md

+61-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ React Native SDK for Cryptr Authentication through SSO
77
- [@cryptr/cryptr-react-native](#cryptrcryptr-react-native)
88
- [Summary](#summary)
99
- [Expo integration](#expo-integration)
10+
- [Install SDK and link to Expo](#install-sdk-and-link-to-expo)
11+
- [Add plugin to handle android's manifest update](#add-plugin-to-handle-androids-manifest-update)
1012
- [Prerequisites](#prerequisites)
1113
- [Android](#android)
1214
- [iOS](#ios)
@@ -35,7 +37,65 @@ React Native SDK for Cryptr Authentication through SSO
3537

3638
## Expo integration
3739

38-
:warning: this is not compatible with Expo Go (neither `link`) and requires a run (`expo run`)
40+
:warning: Follow below steps to use our SDK with Expo
41+
42+
### Install SDK and link to Expo
43+
44+
```bash
45+
npm i @cryptr/cryptr-react-native
46+
47+
// Expo link
48+
(npx) expo install @cryptr/cryptr-react-native
49+
50+
```
51+
52+
### Add plugin to handle android's manifest update
53+
54+
1. Create a file to insert in your expo config, ex named `insertCryptrStrategyPlugin.js` with below code
55+
56+
```javascript
57+
const { withAppBuildGradle } = require('@expo/config-plugins');
58+
59+
module.exports = function withAndroidStrategiesPlugin(config) {
60+
return withAppBuildGradle(config, (config) => {
61+
const targetSdkVersionLine = "targetSdkVersion rootProject.ext.targetSdkVersion";
62+
const manifestPlaceholders = 'manifestPlaceholders = [cryptrDomain: "your-app-domain", cryptrScheme: "cryptr"]';
63+
64+
// Check if the manifestPlaceholders already exist
65+
if (!config.modResults.contents.includes(manifestPlaceholders)) {
66+
config.modResults.contents = config.modResults.contents.replace(
67+
targetSdkVersionLine,
68+
`${targetSdkVersionLine}\n ${manifestPlaceholders}`
69+
);
70+
}
71+
72+
return config;
73+
});
74+
};
75+
```
76+
77+
2. add config to your expo config
78+
79+
Update your `app.json` file to add the above file as plugin
80+
81+
```json
82+
// ./app.json
83+
{
84+
"expo" : {
85+
//...
86+
"plugins": [
87+
//...
88+
"./insertCryptrStrategyPlugin"
89+
]
90+
}
91+
}
92+
````
93+
94+
3. rebuild Expo
95+
96+
```bash
97+
(npx) expo prebuild
98+
```
3999

40100
## Prerequisites
41101

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cryptr/cryptr-react-native",
3-
"version": "0.3.2",
3+
"version": "1.0.0",
44
"description": "React Native SDK for Cryptr Authentication",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)