Skip to content

Commit 75ea612

Browse files
committed
(ios) Adding ability to receive a payment via NFC (bolt card)
1 parent 57faa66 commit 75ea612

11 files changed

Lines changed: 653 additions & 27 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@
339339
DCCFE6C22B7140FA002FFF11 /* LoggerFactory+Foreground.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */; };
340340
DCCFE6C52B714226002FFF11 /* LoggerFactory+Background.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */; };
341341
DCD1208728663F4A00EB39C5 /* TransactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1208628663F4A00EB39C5 /* TransactionsView.swift */; };
342+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD1BFD52CE775E500C2B811 /* NfcReader.swift */; };
342343
DCD5FF4326A0D34B009CC666 /* EqualSizes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */; };
343344
DCD777D226DE9FE800979A12 /* DelayedSave.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD777D126DE9FE800979A12 /* DelayedSave.swift */; };
344345
DCD7E0AC28EC32CB009C30E5 /* BusinessManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */; };
@@ -741,6 +742,7 @@
741742
DCCFE6C12B7140FA002FFF11 /* LoggerFactory+Foreground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Foreground.swift"; sourceTree = "<group>"; };
742743
DCCFE6C32B714171002FFF11 /* LoggerFactory+Background.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoggerFactory+Background.swift"; sourceTree = "<group>"; };
743744
DCD1208628663F4A00EB39C5 /* TransactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionsView.swift; sourceTree = "<group>"; };
745+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NfcReader.swift; sourceTree = "<group>"; };
744746
DCD5FF4226A0D34B009CC666 /* EqualSizes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EqualSizes.swift; sourceTree = "<group>"; };
745747
DCD777D126DE9FE800979A12 /* DelayedSave.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedSave.swift; sourceTree = "<group>"; };
746748
DCD7E0AB28EC32CB009C30E5 /* BusinessManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BusinessManager.swift; sourceTree = "<group>"; };
@@ -969,6 +971,7 @@
969971
53BEF1337AFCFF0AE82A46BD /* utils */,
970972
DCACF6EE2566D0A60009B01E /* extensions */,
971973
DCA6DEC42829BD060073C658 /* xpc */,
974+
DCD1BFD42CE775CE00C2B811 /* nfc */,
972975
DCE3C7A92A6AD39E00F4D385 /* mempool */,
973976
DCCFE6AC2B6430BD002FFF11 /* logging */,
974977
);
@@ -1568,6 +1571,14 @@
15681571
path = transactions;
15691572
sourceTree = "<group>";
15701573
};
1574+
DCD1BFD42CE775CE00C2B811 /* nfc */ = {
1575+
isa = PBXGroup;
1576+
children = (
1577+
DCD1BFD52CE775E500C2B811 /* NfcReader.swift */,
1578+
);
1579+
path = nfc;
1580+
sourceTree = "<group>";
1581+
};
15711582
DCDD9ECC28637390001800A3 /* main */ = {
15721583
isa = PBXGroup;
15731584
children = (
@@ -2096,6 +2107,7 @@
20962107
DC4CBC922D677D4F00129BDB /* Details_Outgoing_ChannelClose.swift in Sources */,
20972108
DCE77A5827C671D600F0FA24 /* ElectrumAddressSheet.swift in Sources */,
20982109
DC384D81265C12B700131772 /* Cache.swift in Sources */,
2110+
DCD1BFD62CE775E900C2B811 /* NfcReader.swift in Sources */,
20992111
DC4CF3CC2BE93311003A957F /* String+PIN.swift in Sources */,
21002112
DCB30E592A0C3F8200E7D7A2 /* LiquidityPolicyView.swift in Sources */,
21012113
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
@@ -5675,6 +5675,9 @@
56755675
}
56765676
}
56775677
}
5678+
},
5679+
"Amount required for card payment" : {
5680+
56785681
},
56795682
"Amount sent (fees included)" : {
56805683
"localizations" : {
@@ -6968,6 +6971,9 @@
69686971
}
69696972
}
69706973
}
6974+
},
6975+
"Awaiting payment…" : {
6976+
69716977
},
69726978
"Back" : {
69736979
"localizations" : {
@@ -8786,6 +8792,9 @@
87868792
}
87878793
}
87888794
},
8795+
"card" : {
8796+
"comment" : "button label - try to make it short"
8797+
},
87898798
"Caused by" : {
87908799
"localizations" : {
87918800
"ar" : {
@@ -10603,6 +10612,9 @@
1060310612
}
1060410613
}
1060510614
}
10615+
},
10616+
"Communicating with card's host…" : {
10617+
1060610618
},
1060710619
"completed at" : {
1060810620
"comment" : "Label in DetailsView_IncomingPayment",
@@ -12222,6 +12234,12 @@
1222212234
}
1222312235
}
1222412236
},
12237+
"Could not communicate with card's wallet" : {
12238+
"comment" : "Error message - scanning lightning invoice"
12239+
},
12240+
"Could not connect to card's host" : {
12241+
"comment" : "Error message - processing bolt card payment"
12242+
},
1222512243
"Could not connect to host:" : {
1222612244
"localizations" : {
1222712245
"ar" : {
@@ -12424,6 +12442,9 @@
1242412442
}
1242512443
}
1242612444
}
12445+
},
12446+
"Cound not communicate with card's wallet" : {
12447+
1242712448
},
1242812449
"Create new contact" : {
1242912450

@@ -15079,6 +15100,9 @@
1507915100
}
1508015101
}
1508115102
}
15103+
},
15104+
"Does not appear to be a bolt card." : {
15105+
1508215106
},
1508315107
"Don't lose your funds:" : {
1508415108
"localizations" : {
@@ -16495,6 +16519,9 @@
1649516519
}
1649616520
}
1649716521
}
16522+
},
16523+
"Error reading tag" : {
16524+
1649816525
},
1649916526
"Error: %@" : {
1650016527
"localizations" : {
@@ -26970,6 +26997,12 @@
2697026997
}
2697126998
}
2697226999
}
27000+
},
27001+
"NFC cababilities not available on this device" : {
27002+
27003+
},
27004+
"NFC reader is already scanning" : {
27005+
2697327006
},
2697427007
"No" : {
2697527008
"extractionState" : "manual",
@@ -27533,6 +27566,9 @@
2753327566
}
2753427567
}
2753527568
}
27569+
},
27570+
"No URI detected in NFC tag" : {
27571+
2753627572
},
2753727573
"No, I don't want to use an onion address" : {
2753827574
"localizations" : {
@@ -27819,6 +27855,9 @@
2781927855
}
2782027856
}
2782127857
}
27858+
},
27859+
"Nothing scanned" : {
27860+
2782227861
},
2782327862
"Notifications" : {
2782427863
"localizations" : {
@@ -33185,6 +33224,9 @@
3318533224
}
3318633225
}
3318733226
}
33227+
},
33228+
"Requesting payment…" : {
33229+
3318833230
},
3318933231
"Requesting Swap-In Address..." : {
3319033232
"extractionState" : "manual",
@@ -38610,6 +38652,12 @@
3861038652
}
3861138653
}
3861238654
},
38655+
"The card's host returned error code: %d" : {
38656+
"comment" : "Error message - processing bolt card payment"
38657+
},
38658+
"The card's host returned error message: %@" : {
38659+
"comment" : "Error message - processing bolt card payment"
38660+
},
3861338661
"The closing transaction is in your transactions list." : {
3861438662
"comment" : "label text",
3861538663
"localizations" : {
@@ -40632,6 +40680,7 @@
4063240680
}
4063340681
},
4063440682
"This appears to be a website (not a lightning invoice):" : {
40683+
"extractionState" : "stale",
4063540684
"localizations" : {
4063640685
"ar" : {
4063740686
"stringUnit" : {
@@ -40670,6 +40719,9 @@
4067040719
}
4067140720
}
4067240721
}
40722+
},
40723+
"This appears to be a website:" : {
40724+
4067340725
},
4067440726
"This doesn't appear to be a Lightning invoice" : {
4067540727
"comment" : "Error message - scanning lightning invoice",
@@ -43664,6 +43716,9 @@
4366443716
}
4366543717
}
4366643718
},
43719+
"Unreadable response from card's host" : {
43720+
"comment" : "Error message - processing bolt card payment"
43721+
},
4366743722
"Unreadable response from service: %@" : {
4366843723
"comment" : "Error message - scanning lightning invoice",
4366943724
"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)