Launch a mobile native implementation of the Persona inquiry flow from React Native.
First, run yarn in the project root.
```
yarn
To test changes to SDK, we will use the Example App in example app.
This will bundle JavaScript and serve it to your React Native sample app. Keep the Metro bundler running in a terminal.
``
yarn example start
Metro bundler compiles source code and caches compiled targets to speed up incremental rebuilds. However, it's possible
that this can lead to random failures if things get out of sync. If you ever run into any weird issues, it's worth
running yarn example start --reset-cache again.
Use the built-in CLI command with Metro running.
``
yarn example ios
Or open ios/example.xcworkspace in XCode and build + run.
Use the built-in CLI command with Metro running.
``
yarn example android
Or open the Android project in Android Studio and build + run.
We use the license_finder gem to ensure that we're only using open source projects with licenses that we explicitly allow. If and when you need to add a new license to our allow-list, you can edit the file at doc/dependency_decisions.yml accordingly. If you check out license_finder's documentation, you'll see how to use the tool to make these updates to the yml file.
`
yarn add react-native-persona
`
`typescript
import {Environment, Inquiry} from "react-native-persona";
// Start an inquiry.
Inquiry.fromTemplate('itmpl_Ygs16MKTkA6obnF8C3Rb17dm')
.environment(Environment.SANDBOX)
.onComplete((inquiryId, status, fields) =>
Alert.alert('Complete', Inquiry ${inquiryId} completed with status "${status}.",),Inquiry ${inquiryId} was cancelled
)
.onCanceled((inquiryId, sessionToken) =>
Alert.alert('Canceled', ),`
)
.onError(error => Alert.alert('Error', error.message))
.build()
.start();
Set your own colors, buttons, fonts, and more. This can be done via the Persona Dashboard. For more information on using the theme editor, see our help article.
Android
Update the sdk version in android/build.gradle
``
implementation 'com.withpersona.sdk2:inquiry:X.Y.Z'
iOS
Update the sdk version in RNPersonaInquiry2.podspec
``
s.dependency 'PersonaInquirySDK2', '~> X.Y.Z'
Go to example/ios directory, update the Podfiles by running
``
pod update PersonaInquirySDK2 --repo-update
pod install --repo-update
React Native
Bump react native version in package.json if needed.
Commit and push changed files including:
- android/build.gradleRNPersonaInquiry2.podspec
- package.json
- example/ios/Podfile.lock`
-