From 6a6c1fcee88eeefcdf1f92c0546d9269f97356d2 Mon Sep 17 00:00:00 2001 From: Thibaud RENAUX Date: Thu, 27 Jun 2024 13:45:05 +0200 Subject: [PATCH 1/4] update version number to 1.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b405f1..47b7bab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cryptr/cryptr-react-native", - "version": "0.3.2", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cryptr/cryptr-react-native", - "version": "0.3.2", + "version": "1.0.0", "license": "MIT", "workspaces": [ "example" diff --git a/package.json b/package.json index 79e5b5d..ca68763 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cryptr/cryptr-react-native", - "version": "0.3.2", + "version": "1.0.0", "description": "React Native SDK for Cryptr Authentication", "main": "lib/commonjs/index", "module": "lib/module/index", From 25ac3795c625bcf6e72c54ec4910590d38c297e5 Mon Sep 17 00:00:00 2001 From: Thibaud RENAUX Date: Thu, 27 Jun 2024 13:46:38 +0200 Subject: [PATCH 2/4] improve expo config in README file --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 260e0eb..25c4070 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ React Native SDK for Cryptr Authentication through SSO - [@cryptr/cryptr-react-native](#cryptrcryptr-react-native) - [Summary](#summary) - [Expo integration](#expo-integration) + - [Run below commands](#run-below-commands) + - [Add plugin to handle android's manifest update](#add-plugin-to-handle-androids-manifest-update) - [Prerequisites](#prerequisites) - [Android](#android) - [iOS](#ios) @@ -35,7 +37,65 @@ React Native SDK for Cryptr Authentication through SSO ## Expo integration -:warning: this is not compatible with Expo Go (neither `link`) and requires a run (`expo run`) +:warning: Follow below steps to use our SDK with Expo + +### Run below commands + +```bash +npm i @cryptr/cryptr-react-native + +// Expo link +(npx) expo install @cryptr/cryptr-react-native + +``` + +### Add plugin to handle android's manifest update + +1. Create a file to insert in your expo config, ex named `insertCryptrStrategyPlugin.js` with below code + +```javascript +const { withAppBuildGradle } = require('@expo/config-plugins'); + +module.exports = function withAndroidStrategiesPlugin(config) { + return withAppBuildGradle(config, (config) => { + const targetSdkVersionLine = "targetSdkVersion rootProject.ext.targetSdkVersion"; + const manifestPlaceholders = 'manifestPlaceholders = [cryptrDomain: "your-app-domain", cryptrScheme: "cryptr"]'; + + // Check if the manifestPlaceholders already exist + if (!config.modResults.contents.includes(manifestPlaceholders)) { + config.modResults.contents = config.modResults.contents.replace( + targetSdkVersionLine, + `${targetSdkVersionLine}\n ${manifestPlaceholders}` + ); + } + + return config; + }); +}; +``` + +2. add config to your expo config + +Update your `app.json` file to add the above file as plugin + +```json +// ./app.json +{ + "expo" : { + //... + "plugins": [ + //... + "./insertCryptrStrategyPlugin" + ] + } +} +```` + +3. rebuild Expo + +```bash +(npx) expo prebuild +``` ## Prerequisites From 06844331e0c786488805f1d6d8580c402905321d Mon Sep 17 00:00:00 2001 From: Thibaud RENAUX Date: Thu, 27 Jun 2024 13:47:28 +0200 Subject: [PATCH 3/4] improve expo config in README file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25c4070..aeeb023 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ React Native SDK for Cryptr Authentication through SSO :warning: Follow below steps to use our SDK with Expo -### Run below commands +### Install SDK and link to Expo ```bash npm i @cryptr/cryptr-react-native From 8b3a9701a8d3897c40e09a0fcb19823d926f560a Mon Sep 17 00:00:00 2001 From: Thibaud RENAUX Date: Thu, 27 Jun 2024 13:51:38 +0200 Subject: [PATCH 4/4] improve expo config in README file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aeeb023..a671ae5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ React Native SDK for Cryptr Authentication through SSO - [@cryptr/cryptr-react-native](#cryptrcryptr-react-native) - [Summary](#summary) - [Expo integration](#expo-integration) - - [Run below commands](#run-below-commands) + - [Install SDK and link to Expo](#install-sdk-and-link-to-expo) - [Add plugin to handle android's manifest update](#add-plugin-to-handle-androids-manifest-update) - [Prerequisites](#prerequisites) - [Android](#android)