mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-10-05 19:28:26 +00:00
iOS NFC support
This commit is contained in:
Vendored
+1
-1
@@ -1 +1 @@
|
||||
019b406e-e983-7898-8d39-07cb52784ef8
|
||||
019b4070-f889-7238-85b0-d02966f5a2f8
|
||||
+488
-331
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -41,6 +41,12 @@
|
||||
<string/>
|
||||
<key>NSUserNotificationUsageDescription</key>
|
||||
<string>This app uses notifications to keep you updated with incoming transactions.</string>
|
||||
<key>NFCReaderUsageDescription</key>
|
||||
<string>This app uses NFC to pay on supported POS</string>
|
||||
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
|
||||
<array>
|
||||
<string>D2760000850101</string>
|
||||
</array>
|
||||
<key>RCTNewArchEnabled</key>
|
||||
<true/>
|
||||
<key>UIAppFonts</key>
|
||||
|
||||
@@ -4,5 +4,10 @@
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>production</string>
|
||||
<key>com.apple.developer.nfc.readersession.formats</key>
|
||||
<array>
|
||||
<string>NDEF</string>
|
||||
<string>TAG</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -83,17 +83,17 @@ import { SerializedDLEQ } from '@cashu/cashu-ts'
|
||||
): Proof[] {
|
||||
let proofs = Array.from(self.proofs.values())
|
||||
.filter(p => !p.isSpent)
|
||||
|
||||
proofs = proofs.filter(p => p.mintUrl === mintUrl)
|
||||
|
||||
// Default: only non-pending proofs. Explicit true returns only pending.
|
||||
const includePending = options.isPending ?? false
|
||||
proofs = proofs.filter(p => p.isPending === includePending)
|
||||
const selectPending = options.isPending ?? false
|
||||
proofs = proofs.filter(p => p.isPending === selectPending)
|
||||
|
||||
if (options.keysetIds?.length) {
|
||||
proofs = proofs.filter(p => options.keysetIds!.includes(p.id))
|
||||
}
|
||||
|
||||
proofs = proofs.filter(p => p.mintUrl === mintUrl)
|
||||
|
||||
if (options.unit) {
|
||||
proofs = proofs.filter(p => p.unit === options.unit)
|
||||
}
|
||||
|
||||
@@ -708,6 +708,7 @@ export const NfcPayScreen = observer(function NfcPayScreen({ route }: Props) {
|
||||
setIsPaid(true)
|
||||
expandHeader()
|
||||
setNfcInfo(transaction.memo || 'Lightning payment settled.')
|
||||
|
||||
}
|
||||
} else {
|
||||
// Fallback (shouldn't happen)
|
||||
@@ -722,6 +723,8 @@ export const NfcPayScreen = observer(function NfcPayScreen({ route }: Props) {
|
||||
} catch (e: any) {
|
||||
log.error(e.message, {error: String(e)})
|
||||
handleError(e)
|
||||
} finally {
|
||||
await NfcManager.cancelTechnologyRequest().catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -785,6 +788,8 @@ export const NfcPayScreen = observer(function NfcPayScreen({ route }: Props) {
|
||||
} catch(e: any) {
|
||||
log.error(e.message, {error: String(e)})
|
||||
handleError(e)
|
||||
} finally {
|
||||
await NfcManager.cancelTechnologyRequest().catch(() => {})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user