To be able to use some wallets in your application, they require a way to redirect back to your app via deep linkin. This short guide will give the practical steps to achieve it on both Android and iOS.
The short version is that you need to tell the Android OS that your application can manage certain urls. You define this URL in your
AndroidManifest.xml and when another app (e.g. a wallet) asks the Android OS to open the url, the OS will check which apps can open it and send you the request.
AndroidManifest.xml and add the following code inside your main
To understand how this works, please refer to the Android's developer official documentation.
Info.plist file and add a new
Next, open your
AppDelegate.mm file and import the
RCTLinkingManager header file and add the following method:
To understand how this works, please refer to the iOS's developer official documentation.
Does this library support tree shaking?
Metro currently does not implement tree shaking, i.e. it does not attempt to remove unused code from the JS bundle. For instance, given this code snippet:
For this reason we recommend using a tool like
Here's why it's more suitable for the app level:
Integration with Build Process: The serializer integrates with your app's build process, which is managed at the app level, not the SDK level.
SDK Independence: SDKs (Software Development Kits) are generally designed to be independent of specific build tools or serializers. They provide functionality to apps but don't dictate how the app should be built or bundled.
Flexibility for App Developers: Using it at the app level allows individual app developers to decide whether they want to use
metro-serializer-esbuildbased on their specific needs and setup.
In summary, you should use
metro-serializer-esbuild at the React Native app level for better integration with the build process and to keep the SDK independent of specific build tools.