@@ -7,6 +7,8 @@ React Native SDK for Cryptr Authentication through SSO
7
7
- [ @cryptr/cryptr-react-native ] ( #cryptrcryptr-react-native )
8
8
- [ Summary] ( #summary )
9
9
- [ 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 )
10
12
- [ Prerequisites] ( #prerequisites )
11
13
- [ Android] ( #android )
12
14
- [ iOS] ( #ios )
@@ -35,7 +37,65 @@ React Native SDK for Cryptr Authentication through SSO
35
37
36
38
## Expo integration
37
39
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
+ ```
39
99
40
100
## Prerequisites
41
101
0 commit comments