We are excited to announce that mParticle now supports React Native on Android and iOS!
Why React Native?
React Native allows you to build an app once and run it on iOS and Android. It does this by providing a single set of APIs that wrap the system UI components on each platform, so the app runs natively on each OS.
Instead of writing two separate apps, you can develop a single set of source code that is shared by both apps, and only drop down into OS-specific logic when there is a need.
The SDK Problem
One of the problems developers face with React Native is implementing third-party SDKs. While a wide variety of SDKs are available for iOS and Android, many do not support React Native, so app developers need to write platform-specific code (which somewhat defeats React Native’s purpose).
In order to use an SDK that doesn’t support React Native, you would need to write a cross-platform interface to the native Objective-C and Java interfaces that are published by that specific company’s SDK.
So instead of being able to just follow installation instructions, you now have to build and maintain a React Native module, per integration that you want to use.
The mParticle Solution
In the same way that React Native abstracts the OS, allowing you to focus on the UI, mParticle abstracts the integrations, allowing you to focus on writing your app.
In many cases, there’s no need to run the third-party SDK on the device, and we can simply send them data server to server. If the SDK does need to run on the device (e.g. to display UI), our native SDKs will take care of initializing the integration SDK based on the credentials you’ve provided in the mParticle platform.
By leveraging the mature mParticle SDKs already available for iOS and Android, and the cross-platform capabilities of React Native, your app can have a single clean codebase connected to all the app services you need to run your business.
Want to Learn More?
Like our other SDKs, the React Native module is open source and hosted on GitHub: mParticle/react-native-mparticle