Compare commits

..
Author SHA1 Message Date
Roman Volosovskyi 260153dccb + 2020-04-15 18:19:00 +03:00
Roman Volosovskyi 366e003337 _ 2020-04-15 17:55:11 +03:00
Roman Volosovskyi 38ca8597e2 Add nfc state events 2020-03-05 14:54:40 +02:00
Vitaliy Vlasov 8fb12850d7 Update status-keycard-java to 3.0.1 2019-12-27 18:31:15 +02:00
4 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -41,5 +41,5 @@ dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'org.bouncycastle:bcprov-jdk15on:1.60'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'com.github.status-im.status-keycard-java:android:2.2.1'
implementation 'com.github.status-im.status-keycard-java:android:3.0.1'
}
@@ -110,9 +110,13 @@ public class SmartCard extends BroadcastReceiver implements CardListener {
boolean on = false;
switch (state) {
case NfcAdapter.STATE_ON:
eventEmitter.emit("keyCardOnNFCEnabled", null);
log("NFC ON");
break;
case NfcAdapter.STATE_OFF:
eventEmitter.emit("keyCardOnNFCDisabled", null);
log("NFC OFF");
break;
default:
log("other");
}
@@ -552,6 +556,9 @@ public class SmartCard extends BroadcastReceiver implements CardListener {
cmdSet.autoOpenSecureChannel();
Log.i(TAG, "secure channel opened");
KeyPath currentPath = new KeyPath(cmdSet.getStatus(KeycardCommandSet.GET_STATUS_P1_KEY_PATH).checkOK().getData());
Log.i(TAG, "Signing with current key path: " + currentPath);
cmdSet.verifyPIN(pin).checkOK();
Log.i(TAG, "pin verified");
+3 -1
View File
@@ -11,10 +11,12 @@ import Keycard from "react-native-status-keycard";
```javascript
import { DeviceEventEmitter } from 'react-native';
// Listen to connect/disconnect events
// Listen to connect/disconnect and nfc events
componentDidMount () {
DeviceEventEmitter.addListener("keyCardOnConnected", () => console.log("keycard connected"));
DeviceEventEmitter.addListener("keyCardOnDisconnected", () => console.log("keycard disconnected"));
DeviceEventEmitter.addListener("keyCardOnNFCEnabled", () => console.log("nfc enabled"));
DeviceEventEmitter.addListener("keyCardOnNFCDisabled", () => console.log("nfc disabled"));
}
```
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "react-native-status-keycard",
"homepage": "https://keycard.status.im/",
"version": "2.5.16",
"version": "2.5.17",
"description": "React Native library to interact with Status Keycard using NFC connection (Android only)",
"main": "index.js",
"scripts": {