InAppWallet
A wallet configurator for In-App Wallet which allows integrating the wallet with React Native
Options
Installation
To use the inAppWallet
you need to add the following dependencies to your project. Find the
command to add them all for convenience below.
Here are the dependencies added:
-
amazon-cognito-identity-js: "^6.3.3"
-
react-native-quick-base64
-
react-native-quick-crypto
-
react-native-aes-gcm-crypto
- This package requires minSdkVersion = 26 on Android
-
@react-native-community/netinfo
-
react-native-inappbrowser-reborn: "^3.7.0" (for Socials Sign In)
-
There's an open issue on RN > 0.72: https://github.com/margelo/react-native-quick-crypto/issues/186 which you can fix by adding the following to your
android/app/build.gradle
file:packagingOptions { pickFirst 'lib/x86/libcrypto.so' pickFirst 'lib/x86_64/libcrypto.so' pickFirst 'lib/armeabi-v7a/libcrypto.so' pickFirst 'lib/arm64-v8a/libcrypto.so' }
-
When building the iOS app in release mode for RN 0.71 you need to enable the OpenSSL framework in XCode. There are several solutions for this here:
-
Usage with ConnectWallet
To allow users to connect to this wallet using the ConnectWallet component, you can add it to ThirdwebProvider's supportedWallets prop.
Usage with useInAppWallet
You can use the useInAppWallet
hook to programmatically connect to the wallet without using the ConnectWallet component.
The wallet also needs to be added in ThirdwebProvider's supportedWallets if you want the wallet to auto-connect on next page load.
The hook will return all the necessary functions you'll need to authenticate and connect to the ina-- wallet.
Connecting with Google sign in
Connecting with email verification
Available connection strategies
Deleting an Account
You can delete an account by calling, deleteActiveAccount
from the InAppWallet instance:
Apple App Store Guidelines
If you want to publish your app to the App Store you will need to allow users to delete their account as per Apple's Guidelines.
You can use the deleteActiveAccount
method for this purpose.