add haptic feedback on connection

This commit is contained in:
Michele Balistreri 2021-01-13 17:19:11 +03:00
parent 4024884b70
commit 40a2dd360a
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
2 changed files with 3 additions and 1 deletions

View File

@ -231,7 +231,7 @@ class SmartCard {
func unblockPin(channel: CardChannel, pairingBase64: String, puk: String, newPin: String, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) throws -> Void {
let cmdSet = try securedCommandSet(channel: channel, pairingBase64: pairingBase64)
try cmdSet.unblockPIN(puk: puk, newPIN: newPin).checkOK()
try cmdSet.unblockPIN(puk: puk, newPIN: newPin).checkAuthOK()
os_log("pin unblocked")
resolve(true)
}

View File

@ -1,5 +1,6 @@
import Foundation
import Keycard
import UIKit
@objc(StatusKeycard)
class StatusKeycard: RCTEventEmitter {
@ -151,6 +152,7 @@ class StatusKeycard: RCTEventEmitter {
if (keycardController == nil) {
self.keycardController = KeycardController(onConnect: { [unowned self] channel in
self.cardChannel = channel
UIImpactFeedbackGenerator(style: .light).impactOccurred()
self.sendEvent(withName: "keyCardOnConnected", body: nil)
self.keycardController?.setAlert("Connected. Don't move your card.")
}, onFailure: { [unowned self] _ in