Skip to content
Closed
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,5 @@ GoogleService-Info.plist
Brainwallet-StoreKit-v1.storekit
/fastlane/report.xml
**/fastlane/test_output/
## Games protection
/Private
## Games protection
brainwallet/PreLaunchResources/topics_schema.plist
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "Private/general-purpose"]
path = Private/general-purpose
url = https://github.com/gruntsoftware/ios-private-general-purpose.git
[submodule "Private/bw-gdlib"]
path = Private/bw-gdlib
url = https://github.com/gruntsoftware/bw-gdlib.git
48 changes: 24 additions & 24 deletions BrainwalletHybrid.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "All">
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
1 change: 1 addition & 0 deletions Private/bw-gdlib
Submodule bw-gdlib added at f8d525
150 changes: 140 additions & 10 deletions brainwallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions brainwallet/Additions/DispatchQueue+Additions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ extension DispatchQueue {
static var walletQueue: DispatchQueue = .init(label: C.walletQueue)

static let walletConcurrentQueue: DispatchQueue = .init(label: C.walletQueue, attributes: .concurrent)

static var userInitQueue: DispatchQueue = .init(label: C.userInitQueue)

}
48 changes: 32 additions & 16 deletions brainwallet/App Launch Classes/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import FirebaseMessaging
import Firebase
import FirebaseCore
import FirebaseAnalytics
import FirebasePerformance
import LocalAuthentication
import SwiftUI
import UIKit
Expand All @@ -13,12 +14,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
var remoteConfigurationHelper: RemoteConfigHelper?
var resourceRequest: NSBundleResourceRequest?

func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

if ProcessInfo.processInfo.environment["IS_RUNNING_UNIT_TESTS"] == "1" {
return true
}

UNUserNotificationCenter.current().setBadgeCount(0) { _ in }

var regionCode2Char: String = "RU"
let countryRussia = MoonpayCountryData(alphaCode2Char: "RU",
alphaCode3Char: "RUS",
Expand All @@ -33,7 +37,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {

NetworkHelper.init().fetchCurrenciesCountries(completion: { countryData in

let currentMoonPayCountry = countryData.filter { $0.alphaCode2Char == regionCode2Char }.first ?? countryRussia
let currentMoonPayCountry = countryData
.filter { $0.alphaCode2Char == regionCode2Char }
.first ?? countryRussia
UserDefaults.userCanBuyInCurrentLocale = currentMoonPayCountry.isBuyAllowed
})

Expand Down Expand Up @@ -83,9 +89,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {

UIView.swizzleSetFrame()
self.applicationController.launch(application: UIApplication.shared, window: thisWindow)

return true
}

func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
// Receved FCM Token
let dataDict: [String: String] = ["token" : fcmToken ?? ""]
Expand Down Expand Up @@ -142,7 +149,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
applicationController.didEnterBackground()
}

func application(_: UIApplication, shouldAllowExtensionPointIdentifier _: UIApplication.ExtensionPointIdentifier) -> Bool {
func application(_: UIApplication,
shouldAllowExtensionPointIdentifier _: UIApplication.ExtensionPointIdentifier) -> Bool {
return false // disable extensions such as custom keyboards for security purposes
}

Expand Down Expand Up @@ -179,7 +187,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {

// Clear the root view controller
thisWindow.rootViewController = nil

/// TBD to restart the app
}
}
Expand All @@ -201,16 +208,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate {
// Production path β€” real plist present
FirebaseApp.configure(options: options)
} else {
let options = FirebaseOptions(
googleAppID: "1:000000000000:ios:0000000000000000000000",
gcmSenderID: "000000000000"
)
options.projectID = "test-project"
options.storageBucket = "test-project.firebasestorage.app"
options.apiKey = "AIzaSy00000000000000000000000000000000"
options.bundleID = Bundle.main.bundleIdentifier ?? "co.brainwallet.test"
FirebaseApp.configure(options: options)
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)
let options = FirebaseOptions(
googleAppID: "1:000000000000:ios:0000000000000000000000",
gcmSenderID: "000000000000"
)
options.projectID = "test-project"
options.storageBucket = "test-project.firebasestorage.app"
options.apiKey = "AIzaSy00000000000000000000000000000000"
options.bundleID = Bundle.main.bundleIdentifier ?? "co.brainwallet.test"
FirebaseApp.configure(options: options)

// Stub config β€” disable everything that uses GoogleDataTransport upload,
// or GDT fails to create its path and crashes on the fake project.
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)
Analytics.setAnalyticsCollectionEnabled(false)
// Performance monitoring off (it also feeds GDT):
Performance.sharedInstance().isDataCollectionEnabled = false
Performance.sharedInstance().isInstrumentationEnabled = false
}
}

Expand Down Expand Up @@ -259,7 +273,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
withCompletionHandler completionHandler: @escaping () -> Void) {

let userInfo = response.notification.request.content.userInfo
NotificationCenter.default.post(name: Notification.Name("didReceiveRemoteNotification"), object: nil, userInfo: userInfo)
NotificationCenter.default
.post(name: Notification.Name("didReceiveRemoteNotification"),
object: nil, userInfo: userInfo)
debugPrint("User tapped notification: \(userInfo)")
completionHandler()
}
Expand Down
Loading