react-native-persona 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +156 -2
- package/RNPersonaInquiry2.podspec +1 -1
- package/android/build.gradle +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## Unreleased
|
|
9
9
|
|
|
10
|
+
## [v2.2.2] - 2022-02-24
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Upgrade to Android Inquiry SDK 2.2.8
|
|
15
|
+
- Upgrade to iOS Inquiry SDK 2.2.4
|
|
16
|
+
|
|
10
17
|
## [v2.2.1] - 2022-02-17
|
|
11
18
|
|
|
12
19
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,3 +1,157 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Persona Android SDKs and Demo
|
|
2
|
+
|
|
3
|
+
## Development
|
|
4
|
+
|
|
5
|
+
First, run yarn in the project root.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
yarn
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To test changes to SDK, we will use the Example App in `example` app.
|
|
12
|
+
|
|
13
|
+
### Start Metro bundler.
|
|
14
|
+
|
|
15
|
+
This will bundle JavaScript and serve it to your React Native sample app. Keep the Metro bundler running in a terminal.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
yarn example start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Metro bundler compiles source code and caches compiled targets to speed up incremental rebuilds. However, it's possible
|
|
22
|
+
that this can lead to random failures if things get out of sync. If you ever run into any weird issues, it's worth
|
|
23
|
+
running `yarn example start --reset-cache` again.
|
|
24
|
+
|
|
25
|
+
### Start example app in iOS simulator
|
|
26
|
+
|
|
27
|
+
Use the built-in CLI command with Metro running.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
yarn example ios
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or open `ios/example.xcworkspace` in XCode and build + run.
|
|
34
|
+
|
|
35
|
+
### Start example app in Android simulator
|
|
36
|
+
|
|
37
|
+
Use the built-in CLI command with Metro running.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
yarn example android
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or open the Android project in Android Studio and build + run.
|
|
44
|
+
|
|
45
|
+
### Install persona-tools
|
|
46
|
+
|
|
47
|
+
Link the binary persona-tool in the example app
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
$ cd example
|
|
51
|
+
$ yarn dev-only:link-bin
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Run the persona-tool to customize the theme
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
$ cd example
|
|
58
|
+
$ yarn persona-tool
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
# Installing in your own project
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
yarn add react-native-persona
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import {Environment, Inquiry} from "react-native-persona";
|
|
73
|
+
|
|
74
|
+
// Start an inquiry.
|
|
75
|
+
Inquiry.fromTemplate('itmpl_Ygs16MKTkA6obnF8C3Rb17dm')
|
|
76
|
+
.environment(Environment.SANDBOX)
|
|
77
|
+
.onComplete((inquiryId, status, fields) =>
|
|
78
|
+
Alert.alert('Complete', `Inquiry ${inquiryId} completed with status "${status}."`,),
|
|
79
|
+
)
|
|
80
|
+
.onCanceled((inquiryId, sessionToken) =>
|
|
81
|
+
Alert.alert('Canceled', `Inquiry ${inquiryId} was cancelled`),
|
|
82
|
+
)
|
|
83
|
+
.onError(error => Alert.alert('Error', error.message))
|
|
84
|
+
.build()
|
|
85
|
+
.start();
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Theming
|
|
89
|
+
|
|
90
|
+
Theming can be handled universally through our persona-tools CLI provided in this repository.
|
|
91
|
+
|
|
92
|
+
To test themes, use the example app:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
cd example
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Link the `persona-tool` using the following command (only necessary during development, linked automatically when the
|
|
99
|
+
package is installed using `yarn add` or `npm install`).
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
yarn dev-only:link-bin
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
To unlink:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
yarn dev-only:unlink-bin
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Run through the tool using `yarn persona-tool` and following the instructions to add the required snippet to
|
|
112
|
+
your `package.json`.
|
|
113
|
+
|
|
114
|
+
Update theme colors accordingly:
|
|
115
|
+
|
|
116
|
+
- Example: Update `persona.androidTheme.backgroundColor` to `#FFFFFF`
|
|
117
|
+
|
|
118
|
+
Run `yarn persona-tool` again.
|
|
119
|
+
|
|
120
|
+
Launch the example app and launch a flow.
|
|
121
|
+
|
|
122
|
+
### Updating SDK Versions
|
|
123
|
+
|
|
124
|
+
*Android*
|
|
125
|
+
|
|
126
|
+
Update the sdk version in `android/build.gradle`
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
implementation 'com.withpersona.sdk2:inquiry:X.Y.Z'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
*iOS*
|
|
133
|
+
|
|
134
|
+
Update the sdk version in `RNPersonaInquiry2.podspec`
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
s.dependency 'PersonaInquirySDK2', '~> X.Y.Z'
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Go to `example/ios` directory, update the Podfiles by running
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
pod update PersonaInquirySDK2 --repo-update
|
|
144
|
+
pod install --repo-update
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
*React Native*
|
|
148
|
+
|
|
149
|
+
Bump react native version in `package.json` if needed.
|
|
150
|
+
|
|
151
|
+
Commit and push changed files including:
|
|
152
|
+
|
|
153
|
+
- `android/build.gradle`
|
|
154
|
+
- `RNPersonaInquiry2.podspec`
|
|
155
|
+
- `package.json`
|
|
156
|
+
- `example/ios/Podfile.lock`
|
|
2
157
|
|
|
3
|
-
Please refer to the docs: https://docs.withpersona.com/docs/react-native-sdk-integration
|
package/android/build.gradle
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-persona",
|
|
3
3
|
"title": "React Native Persona",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.2",
|
|
5
5
|
"description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"name": "Persona Identities, Inc.",
|
|
45
45
|
"email": "support@withpersona.com"
|
|
46
46
|
},
|
|
47
|
-
"homepage": "https://docs.withpersona.com/docs/react-native-sdk-
|
|
47
|
+
"homepage": "https://docs.withpersona.com/docs/react-native-sdk-integration",
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"licenseFilename": "LICENSE",
|
|
50
|
-
"readmeFilename": "
|
|
50
|
+
"readmeFilename": "PUBLIC.md",
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": "*",
|
|
53
53
|
"react-native": "*"
|