Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ios) Playground: Bolt Card + Phoenix Wallet #665

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
object Versions {
const val lightningKmp = "1.8.4"
const val secp256k1 = "0.14.0"
const val torMobile = "0.2.0"

const val kotlin = "1.9.22"

Expand Down
271 changes: 263 additions & 8 deletions phoenix-ios/phoenix-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "d649fbe2be50831fdb28cb2641e76bb148d3b4a074f1350225d4c038ab447877",
"pins" : [
{
"identity" : "abseil-cpp-swiftpm",
Expand Down Expand Up @@ -126,6 +127,15 @@
"version" : "2.1.1"
}
},
{
"identity" : "swcrypt",
"kind" : "remoteSourceControl",
"location" : "https://github.com/soyersoyer/SwCrypt",
"state" : {
"revision" : "d18cf90973a32dc0d28f94eec91faf14ae8b4443",
"version" : "5.1.4"
}
},
{
"identity" : "swift-async-algorithms",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -172,5 +182,5 @@
}
}
],
"version" : 2
"version" : 3
}
22 changes: 9 additions & 13 deletions phoenix-ios/phoenix-ios/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
UINavigationBar.appearance().compactAppearance = navBarAppearance
UINavigationBar.appearance().standardAppearance = navBarAppearance

#if !targetEnvironment(simulator) // push notifications don't work on iOS simulator
UIApplication.shared.registerForRemoteNotifications()
#endif
// Push notifictions now work on the iOS simulator.
// But only for:
// - Macs with Apple Silicon processor
// - Macs with Intel processor & the T2 security chip
// https://support.apple.com/en-us/103265
//
UIApplication.shared.registerForRemoteNotifications()

FirebaseApp.configure()
Messaging.messaging().delegate = self
Expand Down Expand Up @@ -218,15 +222,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
log.trace("application(_:didReceiveRemoteNotification:fetchCompletionHandler:)")
log.debug("remote notification: \(userInfo)")

// If the app is in the foreground:
// - we can ignore this notification
//
// If the app is in the background:
// - this notification was delivered to the notifySrvExt, which is in charge of processing it

DispatchQueue.main.async {
completionHandler(.noData)
}
PushManager.processRemoteNotification(userInfo, completionHandler)
}

func messaging(
Expand Down Expand Up @@ -281,7 +277,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
business.databaseManager.paymentsDb { paymentsDb, _ in

let fakePaymentId = WalletPaymentId.IncomingPaymentId(paymentHash: Bitcoin_kmpByteVector32.random())
paymentsDb?.deletePayment(paymentId: fakePaymentId) { _ in
paymentsDb?.deletePayment(paymentId: fakePaymentId, notify: false) { _ in
// Nothing is actually deleted
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "boltcard.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions phoenix-ios/phoenix-ios/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>D2760000850101</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>co.acinq.phoenix.WatchTower</string>
Expand Down Expand Up @@ -85,12 +89,16 @@
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
<true/>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NFCReaderUsageDescription</key>
<string>The app would like to scan an NFC card.</string>
<key>NSCameraUsageDescription</key>
<string>Phoenix would like to use the camera to scan payment requests.</string>
<key>NSFaceIDUsageDescription</key>
Expand Down Expand Up @@ -136,7 +144,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
<true/>
</dict>
</plist>
12 changes: 12 additions & 0 deletions phoenix-ios/phoenix-ios/InfoPlist.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
}
}
},
"NFCReaderUsageDescription" : {
"comment" : "Privacy - NFC Scan Usage Description",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "The app would like to scan an NFC card."
}
}
}
},
"NSCameraUsageDescription" : {
"comment" : "Privacy - Camera Usage Description",
"extractionState" : "extracted_with_value",
Expand Down
Loading