Migrate from React Native SDK v1 to v2
React Native SDK v2 brings support for Dynamic Flow Templates, which represent the next generation of Persona’s inquiry flow. Dynamic Flow Templates allow for greater flexibility in data collection by allowing custom UIs and collection fields.
Dynamic Flow Templates support versioning and fully custom, component-based views. If you are an existing customer and are interested in using Dynamic Flow Templates, please contact us or talk to your CSM.
Am I using Dynamic Flow Templates?
If your template ID starts with tmpl_
, then you are using the old Template and should use the React Native SDK v1.
If your template ID starts with itmpl_
, then you are using the new Dynamic Flow Template and must use React Native SDK v2.
I am an existing customer using React Native SDK v1. Do I need to migrate?
You must use React Native SDK v2 if you are using Dynamic Flow Templates. Inquiries created via Dynamic Flow Templates will not work properly with React Native SDK v1.
Existing users who are not using Dynamic Flow Templates will not need to migrate to React Native SDK v2, and React Native SDK v1 will continue working for the immediate future. However, we encourage using the latest version whenever possible to take advantage of improvements and bug fixes.
If you have a hard reliance on removed features, but want/need to use Dynamic Flow Templates, please contact us or talk to your CSM for a migration path.
What do I need to do to migrate to React Native SDK v2 API?
The following table lists breaking changes in the 2.x version of our SDK.
Update dependencies
React Native Dependencies
In package.json
, update the latest version of the React Native SDK v2.
iOS dependencies
Update the pods with cd ios && pod install
.
Updated callbacks
Before
After
Supporting both v1 and v2 in parallel
Make sure the v1 instance is at least React Native SDK v1.3.0.
Update Android
Add the following snippet to your app/build.gradle
file to prevent a compilation error.
Alias versions of the SDK
Alias the two packages with different names.
In your files, reference the two packages separately.