@regulaforensics/react-native-document-reader-api 6.7.2 → 6.7.4
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/RNDocumentReaderApi.podspec +1 -1
- package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +2 -5
- package/example/App.js +9 -6
- package/example/package.json +1 -1
- package/ios/RGLWJSONConstructor.m +1 -1
- package/ios/RNRegulaDocumentReader.m +8 -8
- package/package.json +1 -1
|
@@ -493,11 +493,8 @@ public class RNRegulaDocumentReaderModule extends ReactContextBaseJavaModule imp
|
|
|
493
493
|
new String[]{"android.nfc.tech.IsoDep"}
|
|
494
494
|
};
|
|
495
495
|
Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
|
499
|
-
flags = PendingIntent.FLAG_IMMUTABLE;
|
|
500
|
-
PendingIntent pendingIntent = PendingIntent.getActivity(activity.getApplicationContext(), 0, intent, flags);
|
|
496
|
+
int flag = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? PendingIntent.FLAG_MUTABLE : 0;
|
|
497
|
+
PendingIntent pendingIntent = PendingIntent.getActivity(activity.getApplicationContext(), 0, intent, flag);
|
|
501
498
|
NfcAdapter.getDefaultAdapter(getActivity()).enableForegroundDispatch(activity, pendingIntent, filters, techList);
|
|
502
499
|
}
|
|
503
500
|
|
package/example/App.js
CHANGED
|
@@ -107,6 +107,7 @@ export default class App extends Component {
|
|
|
107
107
|
fullName: "Please wait...",
|
|
108
108
|
doRfid: false,
|
|
109
109
|
isReadingRfidCustomUi: false,
|
|
110
|
+
rfidProgress: -1,
|
|
110
111
|
canRfid: false,
|
|
111
112
|
canRfidTitle: '(unavailable)',
|
|
112
113
|
scenarios: [],
|
|
@@ -158,7 +159,9 @@ export default class App extends Component {
|
|
|
158
159
|
updateRfidUI(results) {
|
|
159
160
|
if (results.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP)
|
|
160
161
|
this.setState({ rfidDescription: Enum.eRFID_DataFile_Type.getTranslation(results.dataFileType) })
|
|
161
|
-
this.setState({ rfidUIHeader: "Reading RFID", rfidUIHeaderColor: "black"
|
|
162
|
+
this.setState({ rfidUIHeader: "Reading RFID", rfidUIHeaderColor: "black" })
|
|
163
|
+
if (results.value != null)
|
|
164
|
+
this.setState({ rfidProgress: results.value / 100 })
|
|
162
165
|
if (Platform.OS === 'ios')
|
|
163
166
|
DocumentReader.setRfidSessionStatus(this.state.rfidDescription + "\n" + results.value + "%", e => { }, e => { })
|
|
164
167
|
}
|
|
@@ -168,19 +171,19 @@ export default class App extends Component {
|
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
displayResults(results) {
|
|
171
|
-
if(results == null) return
|
|
174
|
+
if (results == null) return
|
|
172
175
|
|
|
173
176
|
results.textFieldValueByType(Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, (value) => {
|
|
174
177
|
this.setState({ fullName: value })
|
|
175
178
|
}, error => console.log(error))
|
|
176
179
|
|
|
177
180
|
results.graphicFieldImageByType(Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, (value) => {
|
|
178
|
-
if(value != null && value != "")
|
|
181
|
+
if (value != null && value != "")
|
|
179
182
|
this.setState({ docFront: { uri: "data:image/png;base64," + value } })
|
|
180
183
|
}, error => console.log(error))
|
|
181
184
|
|
|
182
185
|
results.graphicFieldImageByType(Enum.eGraphicFieldType.GF_PORTRAIT, (value) => {
|
|
183
|
-
if(value != null && value != "")
|
|
186
|
+
if (value != null && value != "")
|
|
184
187
|
this.setState({ portrait: { uri: "data:image/png;base64," + value } })
|
|
185
188
|
}, error => console.log(error))
|
|
186
189
|
}
|
|
@@ -208,7 +211,7 @@ export default class App extends Component {
|
|
|
208
211
|
render() {
|
|
209
212
|
return (
|
|
210
213
|
<View style={styles.container}>
|
|
211
|
-
{(this.state.isReadingRfidCustomUi
|
|
214
|
+
{(this.state.isReadingRfidCustomUi) && <View style={styles.container}>
|
|
212
215
|
<Text style={{ paddingBottom: 30, fontSize: 23, color: this.state.rfidUIHeaderColor }}>{this.state.rfidUIHeader}</Text>
|
|
213
216
|
<Text style={{ paddingBottom: 50, fontSize: 20 }}>{this.state.rfidDescription}</Text>
|
|
214
217
|
<Progress.Bar width={200} useNativeDriver={true} color="#4285F4" progress={this.state.rfidProgress} />
|
|
@@ -218,7 +221,7 @@ export default class App extends Component {
|
|
|
218
221
|
</View>
|
|
219
222
|
}
|
|
220
223
|
{!this.state.isReadingRfidCustomUi && <View style={styles.container}>
|
|
221
|
-
|
|
224
|
+
<Text /><Text />
|
|
222
225
|
<Text style={{
|
|
223
226
|
top: 1,
|
|
224
227
|
left: 1,
|
package/example/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"lint": "eslint ."
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@regulaforensics/react-native-document-reader-api": "6.7.
|
|
13
|
+
"@regulaforensics/react-native-document-reader-api": "6.7.4",
|
|
14
14
|
"@regulaforensics/react-native-document-reader-core-fullrfid": "6.7.0",
|
|
15
15
|
"react": "17.0.2",
|
|
16
16
|
"react-native": "^0.67.0",
|
|
@@ -13,26 +13,26 @@ RGLRFIDCertificatesCallback taCertificateCompletion;
|
|
|
13
13
|
RFIDDelegateNoPA* rfidDelegateNoPA;
|
|
14
14
|
typedef void (^RGLRFIDSignatureCallback)(NSData *signature);
|
|
15
15
|
RGLRFIDSignatureCallback taSignatureCompletion;
|
|
16
|
-
RNRegulaDocumentReader*
|
|
16
|
+
RNRegulaDocumentReader* documentReaderPlugin;
|
|
17
17
|
|
|
18
18
|
@implementation RFIDDelegateNoPA
|
|
19
19
|
|
|
20
20
|
- (void)onRequestTACertificatesWithKey:(NSString *)keyCAR callback:(RGLRFIDCertificatesCallback)callback {
|
|
21
21
|
taCertificateCompletion = callback;
|
|
22
|
-
[
|
|
22
|
+
[documentReaderPlugin sendEventWithName:taCertificateCompletionEvent body:@{@"msg": keyCAR}];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
- (void)onRequestTASignatureWithChallenge:(RGLTAChallenge *)challenge callback:(void(^)(NSData *signature))callback {
|
|
26
26
|
taSignatureCompletion = callback;
|
|
27
|
-
[
|
|
27
|
+
[documentReaderPlugin sendEventWithName:taSignatureCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRGLTAChallenge:challenge]]}];
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
- (void)didChipConnected {
|
|
31
|
-
[
|
|
31
|
+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
- (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
|
|
35
|
-
[
|
|
35
|
+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@end
|
|
@@ -120,15 +120,15 @@ typedef void (^Callback)(NSString* response);
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
- (void)didChipConnected {
|
|
123
|
-
[
|
|
123
|
+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
- (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
|
|
127
|
-
[
|
|
127
|
+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(RCTResponseSenderBlock)sCallback:(RCTResponseSenderBlock)eCallback) {
|
|
131
|
-
|
|
131
|
+
documentReaderPlugin = self;
|
|
132
132
|
Callback successCallback = ^(NSString* response){
|
|
133
133
|
sCallback(@[response]);
|
|
134
134
|
};
|
package/package.json
CHANGED