Skip to content

Commit 799918a

Browse files
committed
(ios) Adding ability to receive a payment via NFC (bolt card)
1 parent 91bd78e commit 799918a

File tree

11 files changed

+654
-27
lines changed

11 files changed

+654
-27
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
DCCFE6C22B7140FA002FFF11 /* LoggerFactory+Foreground.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */; };
319319
DCCFE6C52B714226002FFF11 /* LoggerFactory+Background.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */; };
320320
DCD1208728663F4A00EB39C5 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1208628663F4A00EB39C5 /* TransactionsView.swift */; };
321+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1BFD52CE775E500C2B811 /* NfcReader.swift */; };
321322
DCD5FF4326A0D34B009CC666 /* EqualSizes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */; };
322323
DCD777D226DE9FE800979A12 /* DelayedSave.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD777D126DE9FE800979A12 /* DelayedSave.swift */; };
323324
DCD7E0AC28EC32CB009C30E5 /* BusinessManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */; };
@@ -714,6 +715,7 @@
714715
DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Foreground.swift"; sourceTree = "<group>"; };
715716
DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Background.swift"; sourceTree = "<group>"; };
716717
DCD1208628663F4A00EB39C5 /* TransactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsView.swift; sourceTree = "<group>"; };
718+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NfcReader.swift; sourceTree = "<group>"; };
717719
DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EqualSizes.swift; sourceTree = "<group>"; };
718720
DCD777D126DE9FE800979A12 /* DelayedSave.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedSave.swift; sourceTree = "<group>"; };
719721
DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusinessManager.swift; sourceTree = "<group>"; };
@@ -944,6 +946,7 @@
944946
53BEF1337AFCFF0AE82A46BD /* utils */,
945947
DCACF6EE2566D0A60009B01E /* extensions */,
946948
DCA6DEC42829BD060073C658 /* xpc */,
949+
DCD1BFD42CE775CE00C2B811 /* nfc */,
947950
DCE3C7A92A6AD39E00F4D385 /* mempool */,
948951
DCCFE6AC2B6430BD002FFF11 /* logging */,
949952
);
@@ -1514,6 +1517,14 @@
15141517
path = transactions;
15151518
sourceTree = "<group>";
15161519
};
1520+
DCD1BFD42CE775CE00C2B811 /* nfc */ = {
1521+
isa = PBXGroup;
1522+
children = (
1523+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */,
1524+
);
1525+
path = nfc;
1526+
sourceTree = "<group>";
1527+
};
15171528
DCDD9ECC28637390001800A3 /* main */ = {
15181529
isa = PBXGroup;
15191530
children = (
@@ -2038,6 +2049,7 @@
20382049
C8D7AA4B09B32AD99C88BB5E /* DisplayConfigurationView.swift in Sources */,
20392050
DCE77A5827C671D600F0FA24 /* ElectrumAddressSheet.swift in Sources */,
20402051
DC384D81265C12B700131772 /* Cache.swift in Sources */,
2052+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */,
20412053
DC4CF3CC2BE93311003A957F /* String+PIN.swift in Sources */,
20422054
DCB30E592A0C3F8200E7D7A2 /* LiquidityPolicyView.swift in Sources */,
20432055
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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6581,6 +6581,9 @@
65816581
}
65826582
}
65836583
}
6584+
},
6585+
"Amount required for card payment" : {
6586+
65846587
},
65856588
"amount sent" : {
65866589
"comment" : "Label in DetailsView_IncomingPayment",
@@ -7801,6 +7804,9 @@
78017804
}
78027805
}
78037806
}
7807+
},
7808+
"Awaiting payment…" : {
7809+
78047810
},
78057811
"Back" : {
78067812
"localizations" : {
@@ -9784,6 +9790,9 @@
97849790
}
97859791
}
97869792
},
9793+
"card" : {
9794+
"comment" : "button label - try to make it short"
9795+
},
97879796
"caused by" : {
97889797

97899798
},
@@ -11535,6 +11544,9 @@
1153511544
}
1153611545
}
1153711546
}
11547+
},
11548+
"Communicating with card's host…" : {
11549+
1153811550
},
1153911551
"completed at" : {
1154011552
"comment" : "Label in DetailsView_IncomingPayment",
@@ -13280,6 +13292,12 @@
1328013292
}
1328113293
}
1328213294
},
13295+
"Could not communicate with card's wallet" : {
13296+
"comment" : "Error message - scanning lightning invoice"
13297+
},
13298+
"Could not connect to card's host" : {
13299+
"comment" : "Error message - processing bolt card payment"
13300+
},
1328313301
"Could not connect to host:" : {
1328413302
"localizations" : {
1328513303
"ar" : {
@@ -13486,6 +13504,9 @@
1348613504
}
1348713505
}
1348813506
}
13507+
},
13508+
"Cound not communicate with card's wallet" : {
13509+
1348913510
},
1349013511
"Create new wallet" : {
1349113512
"localizations" : {
@@ -16070,6 +16091,9 @@
1607016091
}
1607116092
}
1607216093
}
16094+
},
16095+
"Does not appear to be a bolt card." : {
16096+
1607316097
},
1607416098
"Don't lose your funds:" : {
1607516099
"localizations" : {
@@ -17526,6 +17550,9 @@
1752617550
}
1752717551
}
1752817552
}
17553+
},
17554+
"Error reading tag" : {
17555+
1752917556
},
1753017557
"Error: %@" : {
1753117558
"localizations" : {
@@ -27731,6 +27758,12 @@
2773127758
}
2773227759
}
2773327760
}
27761+
},
27762+
"NFC cababilities not available on this device" : {
27763+
27764+
},
27765+
"NFC reader is already scanning" : {
27766+
2773427767
},
2773527768
"No" : {
2773627769
"extractionState" : "manual",
@@ -28257,6 +28290,9 @@
2825728290
}
2825828291
}
2825928292
}
28293+
},
28294+
"No URI detected in NFC tag" : {
28295+
2826028296
},
2826128297
"No, I don't want to use an onion address" : {
2826228298

@@ -28503,6 +28539,9 @@
2850328539
}
2850428540
}
2850528541
}
28542+
},
28543+
"Nothing scanned" : {
28544+
2850628545
},
2850728546
"Notifications" : {
2850828547
"localizations" : {
@@ -33934,6 +33973,9 @@
3393433973
}
3393533974
}
3393633975
}
33976+
},
33977+
"Requesting payment…" : {
33978+
3393733979
},
3393833980
"Requesting Swap-In Address..." : {
3393933981
"extractionState" : "manual",
@@ -39436,6 +39478,12 @@
3943639478
}
3943739479
}
3943839480
},
39481+
"The card's host returned error code: %d" : {
39482+
"comment" : "Error message - processing bolt card payment"
39483+
},
39484+
"The card's host returned error message: %@" : {
39485+
"comment" : "Error message - processing bolt card payment"
39486+
},
3943939487
"The closing transaction is in your transactions list." : {
3944039488
"comment" : "label text",
3944139489
"localizations" : {
@@ -41443,6 +41491,7 @@
4144341491
}
4144441492
},
4144541493
"This appears to be a website (not a lightning invoice):" : {
41494+
"extractionState" : "stale",
4144641495
"localizations" : {
4144741496
"ar" : {
4144841497
"stringUnit" : {
@@ -41481,6 +41530,9 @@
4148141530
}
4148241531
}
4148341532
}
41533+
},
41534+
"This appears to be a website:" : {
41535+
4148441536
},
4148541537
"This doesn't appear to be a Lightning invoice" : {
4148641538
"comment" : "Error message - scanning lightning invoice",
@@ -44618,6 +44670,9 @@
4461844670
}
4461944671
}
4462044672
},
44673+
"Unreadable response from card's host" : {
44674+
"comment" : "Error message - processing bolt card payment"
44675+
},
4462144676
"Unreadable response from service: (origin)" : {
4462244677
"comment" : "Error message - scanning lightning invoice",
4462344678
"extractionState" : "stale",
@@ -46087,6 +46142,7 @@
4608746142
}
4608846143
},
4608946144
"Wallet creation options" : {
46145+
"extractionState" : "stale",
4609046146
"localizations" : {
4609146147
"ar" : {
4609246148
"stringUnit" : {

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)