Skip to content

Commit 367ed9f

Browse files
committed
(ios) Adding ability to receive a payment via NFC (bolt card)
1 parent 0458b73 commit 367ed9f

File tree

11 files changed

+653
-27
lines changed

11 files changed

+653
-27
lines changed

phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
DCCFE6C22B7140FA002FFF11 /* LoggerFactory+Foreground.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */; };
337337
DCCFE6C52B714226002FFF11 /* LoggerFactory+Background.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */; };
338338
DCD1208728663F4A00EB39C5 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1208628663F4A00EB39C5 /* TransactionsView.swift */; };
339+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1BFD52CE775E500C2B811 /* NfcReader.swift */; };
339340
DCD5FF4326A0D34B009CC666 /* EqualSizes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */; };
340341
DCD777D226DE9FE800979A12 /* DelayedSave.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD777D126DE9FE800979A12 /* DelayedSave.swift */; };
341342
DCD7E0AC28EC32CB009C30E5 /* BusinessManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */; };
@@ -736,6 +737,7 @@
736737
DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Foreground.swift"; sourceTree = "<group>"; };
737738
DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Background.swift"; sourceTree = "<group>"; };
738739
DCD1208628663F4A00EB39C5 /* TransactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsView.swift; sourceTree = "<group>"; };
740+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NfcReader.swift; sourceTree = "<group>"; };
739741
DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EqualSizes.swift; sourceTree = "<group>"; };
740742
DCD777D126DE9FE800979A12 /* DelayedSave.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedSave.swift; sourceTree = "<group>"; };
741743
DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusinessManager.swift; sourceTree = "<group>"; };
@@ -964,6 +966,7 @@
964966
53BEF1337AFCFF0AE82A46BD /* utils */,
965967
DCACF6EE2566D0A60009B01E /* extensions */,
966968
DCA6DEC42829BD060073C658 /* xpc */,
969+
DCD1BFD42CE775CE00C2B811 /* nfc */,
967970
DCE3C7A92A6AD39E00F4D385 /* mempool */,
968971
DCCFE6AC2B6430BD002FFF11 /* logging */,
969972
);
@@ -1561,6 +1564,14 @@
15611564
path = transactions;
15621565
sourceTree = "<group>";
15631566
};
1567+
DCD1BFD42CE775CE00C2B811 /* nfc */ = {
1568+
isa = PBXGroup;
1569+
children = (
1570+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */,
1571+
);
1572+
path = nfc;
1573+
sourceTree = "<group>";
1574+
};
15641575
DCDD9ECC28637390001800A3 /* main */ = {
15651576
isa = PBXGroup;
15661577
children = (
@@ -2088,6 +2099,7 @@
20882099
DC4CBC922D677D4F00129BDB /* Details_Outgoing_ChannelClose.swift in Sources */,
20892100
DCE77A5827C671D600F0FA24 /* ElectrumAddressSheet.swift in Sources */,
20902101
DC384D81265C12B700131772 /* Cache.swift in Sources */,
2102+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */,
20912103
DC4CF3CC2BE93311003A957F /* String+PIN.swift in Sources */,
20922104
DCB30E592A0C3F8200E7D7A2 /* LiquidityPolicyView.swift in Sources */,
20932105
DCEAE5B72943CC7400320C46 /* RangeSheet.swift in Sources */,

phoenix-ios/phoenix-ios/Info.plist

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@
8585
</array>
8686
<key>CFBundleVersion</key>
8787
<string>$(CURRENT_PROJECT_VERSION)</string>
88+
<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
89+
<true/>
8890
<key>FirebaseAppDelegateProxyEnabled</key>
8991
<false/>
9092
<key>ITSAppUsesNonExemptEncryption</key>
9193
<false/>
9294
<key>LSRequiresIPhoneOS</key>
9395
<true/>
96+
<key>NFCReaderUsageDescription</key>
97+
<string>The app would like to scan an NFC card.</string>
9498
<key>NSCameraUsageDescription</key>
9599
<string>Phoenix would like to use the camera to scan payment requests.</string>
96100
<key>NSFaceIDUsageDescription</key>
@@ -136,7 +140,5 @@
136140
<string>UIInterfaceOrientationLandscapeLeft</string>
137141
<string>UIInterfaceOrientationLandscapeRight</string>
138142
</array>
139-
<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
140-
<true/>
141143
</dict>
142144
</plist>

phoenix-ios/phoenix-ios/InfoPlist.xcstrings

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@
3737
}
3838
}
3939
},
40+
"NFCReaderUsageDescription" : {
41+
"comment" : "Privacy - NFC Scan Usage Description",
42+
"extractionState" : "extracted_with_value",
43+
"localizations" : {
44+
"en" : {
45+
"stringUnit" : {
46+
"state" : "new",
47+
"value" : "The app would like to scan an NFC card."
48+
}
49+
}
50+
}
51+
},
4052
"NSCameraUsageDescription" : {
4153
"comment" : "Privacy - Camera Usage Description",
4254
"extractionState" : "extracted_with_value",

phoenix-ios/phoenix-ios/Localizable.xcstrings

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5666,6 +5666,9 @@
56665666
}
56675667
}
56685668
}
5669+
},
5670+
"Amount required for card payment" : {
5671+
56695672
},
56705673
"Amount sent (fees included)" : {
56715674
"localizations" : {
@@ -6959,6 +6962,9 @@
69596962
}
69606963
}
69616964
}
6965+
},
6966+
"Awaiting payment…" : {
6967+
69626968
},
69636969
"Back" : {
69646970
"localizations" : {
@@ -8772,6 +8778,9 @@
87728778
}
87738779
}
87748780
},
8781+
"card" : {
8782+
"comment" : "button label - try to make it short"
8783+
},
87758784
"Caused by" : {
87768785
"localizations" : {
87778786
"ar" : {
@@ -10589,6 +10598,9 @@
1058910598
}
1059010599
}
1059110600
}
10601+
},
10602+
"Communicating with card's host…" : {
10603+
1059210604
},
1059310605
"completed at" : {
1059410606
"comment" : "Label in DetailsView_IncomingPayment",
@@ -12208,6 +12220,12 @@
1220812220
}
1220912221
}
1221012222
},
12223+
"Could not communicate with card's wallet" : {
12224+
"comment" : "Error message - scanning lightning invoice"
12225+
},
12226+
"Could not connect to card's host" : {
12227+
"comment" : "Error message - processing bolt card payment"
12228+
},
1221112229
"Could not connect to host:" : {
1221212230
"localizations" : {
1221312231
"ar" : {
@@ -12410,6 +12428,9 @@
1241012428
}
1241112429
}
1241212430
}
12431+
},
12432+
"Cound not communicate with card's wallet" : {
12433+
1241312434
},
1241412435
"Create new wallet" : {
1241512436
"localizations" : {
@@ -15062,6 +15083,9 @@
1506215083
}
1506315084
}
1506415085
}
15086+
},
15087+
"Does not appear to be a bolt card." : {
15088+
1506515089
},
1506615090
"Don't lose your funds:" : {
1506715091
"localizations" : {
@@ -16472,6 +16496,9 @@
1647216496
}
1647316497
}
1647416498
}
16499+
},
16500+
"Error reading tag" : {
16501+
1647516502
},
1647616503
"Error: %@" : {
1647716504
"localizations" : {
@@ -26934,6 +26961,12 @@
2693426961
}
2693526962
}
2693626963
}
26964+
},
26965+
"NFC cababilities not available on this device" : {
26966+
26967+
},
26968+
"NFC reader is already scanning" : {
26969+
2693726970
},
2693826971
"No" : {
2693926972
"extractionState" : "manual",
@@ -27497,6 +27530,9 @@
2749727530
}
2749827531
}
2749927532
}
27533+
},
27534+
"No URI detected in NFC tag" : {
27535+
2750027536
},
2750127537
"No, I don't want to use an onion address" : {
2750227538
"localizations" : {
@@ -27780,6 +27816,9 @@
2778027816
}
2778127817
}
2778227818
}
27819+
},
27820+
"Nothing scanned" : {
27821+
2778327822
},
2778427823
"Notifications" : {
2778527824
"localizations" : {
@@ -33146,6 +33185,9 @@
3314633185
}
3314733186
}
3314833187
}
33188+
},
33189+
"Requesting payment…" : {
33190+
3314933191
},
3315033192
"Requesting Swap-In Address..." : {
3315133193
"extractionState" : "manual",
@@ -38571,6 +38613,12 @@
3857138613
}
3857238614
}
3857338615
},
38616+
"The card's host returned error code: %d" : {
38617+
"comment" : "Error message - processing bolt card payment"
38618+
},
38619+
"The card's host returned error message: %@" : {
38620+
"comment" : "Error message - processing bolt card payment"
38621+
},
3857438622
"The closing transaction is in your transactions list." : {
3857538623
"comment" : "label text",
3857638624
"localizations" : {
@@ -40593,6 +40641,7 @@
4059340641
}
4059440642
},
4059540643
"This appears to be a website (not a lightning invoice):" : {
40644+
"extractionState" : "stale",
4059640645
"localizations" : {
4059740646
"ar" : {
4059840647
"stringUnit" : {
@@ -40631,6 +40680,9 @@
4063140680
}
4063240681
}
4063340682
}
40683+
},
40684+
"This appears to be a website:" : {
40685+
4063440686
},
4063540687
"This doesn't appear to be a Lightning invoice" : {
4063640688
"comment" : "Error message - scanning lightning invoice",
@@ -43625,6 +43677,9 @@
4362543677
}
4362643678
}
4362743679
},
43680+
"Unreadable response from card's host" : {
43681+
"comment" : "Error message - processing bolt card payment"
43682+
},
4362843683
"Unreadable response from service: %@" : {
4362943684
"comment" : "Error message - scanning lightning invoice",
4363043685
"localizations" : {

phoenix-ios/phoenix-ios/Phoenix.entitlements

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<array>
1313
<string>CloudKit</string>
1414
</array>
15+
<key>com.apple.developer.nfc.readersession.formats</key>
16+
<array>
17+
<string>TAG</string>
18+
</array>
1519
<key>com.apple.security.application-groups</key>
1620
<array>
1721
<string>group.co.acinq.phoenix</string>

0 commit comments

Comments
 (0)