How does one use a different react native package (separate for android and ios)
hi we are looking to build a SDK using react native that is usable on ios and android.
one of the functionality we want to include is the Razorpay payment gateway - https://razorpay.com/docs/payment-gateway/react-native-integration/standard/
how do we integrate this kind of a package into a Bob build ?
did you find any solution ?
We need to document best practices how to do so for both platforms.
We are currently using the mapbox-gl, for a component. We are customizing the component as required and export our component in index. For the example App for make it work, we have added the mapbox-gl package in example project too. Is it required to add the mapbox-gl package in the Application where we install our library ,since the mapbox-gl is mentioned in the library dependencies ? This should be automatically installed while we installed the library right ?
I'm struggling with this too; I want to create a rn package that uses 3rd party sdk but I'm pretty lost on how to approach it :(
Anyone found a solution to this? Seems like a very common issue (also asked in https://github.com/callstack/react-native-builder-bob/issues/83 I believe).
P.S. I tried doing pod init and using CocoaPods to get the 3rd party sdk working but to no avail. 😞
I ended up adding the dependencies that require linking to my devDependencies and peerDependencies, effectively leaving the installation part of those dependencies to the user of my package.
@sandys From what I'm understanding from your question - you would like 2 different implementations for a single use SDK that is used dynamically by Android and iOS. You could simply create a higher-order-component or higher-order-function that renders the specific implementation that you want based on Platform.OS. Even better would be to have an abstract or interface class so that both implementations have a common contract that your bridge client can call over the bridge.
A good example would be react-native-maps that utilizes apple maps for iOS and google maps for Android. You could look at their source code to see what they did as a good practice.
@Vlu Thanks !