Skip to content

Commit 28a6352

Browse files
author
Jenkins
committed
6.7.4
1 parent 91be822 commit 28a6352

6 files changed

Lines changed: 22 additions & 22 deletions

File tree

android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,8 @@ private void startForegroundDispatch(final Activity activity) {
493493
new String[]{"android.nfc.tech.IsoDep"}
494494
};
495495
Intent intent = new Intent(activity.getApplicationContext(), activity.getClass());
496-
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
497-
int flags = 0;
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);
501498
NfcAdapter.getDefaultAdapter(getActivity()).enableForegroundDispatch(activity, pendingIntent, filters, techList);
502499
}
503500

example/App.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export default class App extends Component {
107107
fullName: "Please wait...",
108108
doRfid: false,
109109
isReadingRfidCustomUi: false,
110+
rfidProgress: -1,
110111
canRfid: false,
111112
canRfidTitle: '(unavailable)',
112113
scenarios: [],
@@ -158,7 +159,9 @@ export default class App extends Component {
158159
updateRfidUI(results) {
159160
if (results.code === Enum.eRFID_NotificationCodes.RFID_NOTIFICATION_PCSC_READING_DATAGROUP)
160161
this.setState({ rfidDescription: Enum.eRFID_DataFile_Type.getTranslation(results.dataFileType) })
161-
this.setState({ rfidUIHeader: "Reading RFID", rfidUIHeaderColor: "black", rfidProgress: results.value / 100 })
162+
this.setState({ rfidUIHeader: "Reading RFID", rfidUIHeaderColor: "black" })
163+
if (results.value != null)
164+
this.setState({ rfidProgress: results.value / 100 })
162165
if (Platform.OS === 'ios')
163166
DocumentReader.setRfidSessionStatus(this.state.rfidDescription + "\n" + results.value + "%", e => { }, e => { })
164167
}
@@ -168,19 +171,19 @@ export default class App extends Component {
168171
}
169172

170173
displayResults(results) {
171-
if(results == null) return
174+
if (results == null) return
172175

173176
results.textFieldValueByType(Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, (value) => {
174177
this.setState({ fullName: value })
175178
}, error => console.log(error))
176179

177180
results.graphicFieldImageByType(Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, (value) => {
178-
if(value != null && value != "")
181+
if (value != null && value != "")
179182
this.setState({ docFront: { uri: "data:image/png;base64," + value } })
180183
}, error => console.log(error))
181184

182185
results.graphicFieldImageByType(Enum.eGraphicFieldType.GF_PORTRAIT, (value) => {
183-
if(value != null && value != "")
186+
if (value != null && value != "")
184187
this.setState({ portrait: { uri: "data:image/png;base64," + value } })
185188
}, error => console.log(error))
186189
}
@@ -208,7 +211,7 @@ export default class App extends Component {
208211
render() {
209212
return (
210213
<View style={styles.container}>
211-
{(this.state.isReadingRfidCustomUi && Platform.OS === 'android') && <View style={styles.container}>
214+
{(this.state.isReadingRfidCustomUi) && <View style={styles.container}>
212215
<Text style={{ paddingBottom: 30, fontSize: 23, color: this.state.rfidUIHeaderColor }}>{this.state.rfidUIHeader}</Text>
213216
<Text style={{ paddingBottom: 50, fontSize: 20 }}>{this.state.rfidDescription}</Text>
214217
<Progress.Bar width={200} useNativeDriver={true} color="#4285F4" progress={this.state.rfidProgress} />
@@ -218,7 +221,7 @@ export default class App extends Component {
218221
</View>
219222
}
220223
{!this.state.isReadingRfidCustomUi && <View style={styles.container}>
221-
<Text/><Text/>
224+
<Text /><Text />
222225
<Text style={{
223226
top: 1,
224227
left: 1,

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"@regulaforensics/react-native-document-reader-api": "6.7.3",
13+
"@regulaforensics/react-native-document-reader-api": "6.7.4",
1414
"@regulaforensics/react-native-document-reader-core-fullrfid": "6.7.0",
1515
"react": "17.0.2",
1616
"react-native": "^0.67.0",

ios/RGLWJSONConstructor.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ +(NSMutableDictionary*)generateCompletion:(NSInteger)action :(RGLDocumentReaderR
201201
break;
202202
case 999:
203203
result[@"results"] = [self generateResultsWithRFID :results :1];
204-
action = 1;
204+
action = 0;
205205
break;
206206
default:
207207
break;

ios/RNRegulaDocumentReader.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
RFIDDelegateNoPA* rfidDelegateNoPA;
1414
typedef void (^RGLRFIDSignatureCallback)(NSData *signature);
1515
RGLRFIDSignatureCallback taSignatureCompletion;
16-
RNRegulaDocumentReader* plugin;
16+
RNRegulaDocumentReader* documentReaderPlugin;
1717

1818
@implementation RFIDDelegateNoPA
1919

2020
- (void)onRequestTACertificatesWithKey:(NSString *)keyCAR callback:(RGLRFIDCertificatesCallback)callback {
2121
taCertificateCompletion = callback;
22-
[plugin sendEventWithName:taCertificateCompletionEvent body:@{@"msg": keyCAR}];
22+
[documentReaderPlugin sendEventWithName:taCertificateCompletionEvent body:@{@"msg": keyCAR}];
2323
}
2424

2525
- (void)onRequestTASignatureWithChallenge:(RGLTAChallenge *)challenge callback:(void(^)(NSData *signature))callback {
2626
taSignatureCompletion = callback;
27-
[plugin sendEventWithName:taSignatureCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRGLTAChallenge:challenge]]}];
27+
[documentReaderPlugin sendEventWithName:taSignatureCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRGLTAChallenge:challenge]]}];
2828
}
2929

3030
- (void)didChipConnected {
31-
[plugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
31+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
3232
}
3333

3434
- (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
35-
[plugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
35+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
3636
}
3737

3838
@end
@@ -120,15 +120,15 @@ - (void)onRequestTASignatureWithChallenge:(RGLTAChallenge *)challenge callback:(
120120
}
121121

122122
- (void)didChipConnected {
123-
[plugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
123+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletion:1]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
124124
}
125125

126126
- (void)didReceivedError:(RGLRFIDErrorCodes)errorCode {
127-
[plugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
127+
[documentReaderPlugin sendEventWithName:rfidNotificationCompletionEvent body:@{@"msg": [RGLWJSONConstructor dictToString:[RGLWJSONConstructor generateRfidNotificationCompletionWithError:2:errorCode]]}]; // int RFID_EVENT_CHIP_DETECTED = 1;
128128
}
129129

130130
RCT_EXPORT_METHOD(exec:(NSString*)moduleName:(NSString*)action:(NSArray*)args:(RCTResponseSenderBlock)sCallback:(RCTResponseSenderBlock)eCallback) {
131-
plugin = self;
131+
documentReaderPlugin = self;
132132
Callback successCallback = ^(NSString* response){
133133
sCallback(@[response]);
134134
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@regulaforensics/react-native-document-reader-api",
3-
"version": "6.7.3",
3+
"version": "6.7.4",
44
"description": "React Native module for reading and validation of identification documents (API framework)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)