diff --git a/.gitignore b/.gitignore index 51b68e22..f7f7e69b 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ Brainwallet-StoreKit-v1.storekit **/fastlane/test_output/ ## Games protection /Private +brainwallet/PreLaunchResources/topics_schema.plist diff --git a/BrainwalletHybrid.xcworkspace/xcshareddata/swiftpm/Package.resolved b/BrainwalletHybrid.xcworkspace/xcshareddata/swiftpm/Package.resolved index a86a4cfb..cd126748 100644 --- a/BrainwalletHybrid.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/BrainwalletHybrid.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "1fae515ecb077b020404ba96ab97a952faae66bc0ab8f22de14421a303e179c1", + "originHash" : "450b00c1b701de371fa0991316782008bccafa5277b4d1b0211814da347afc10", "pins" : [ { "identity" : "abseil-cpp-binary", @@ -28,22 +28,13 @@ "version" : "6.17.2" } }, - { - "identity" : "brainwalletiosstorekit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/gruntsoftware/BrainwalletiOSStorekit.git", - "state" : { - "revision" : "3465dba4eddab73f68d441db08b710aeb284b198", - "version" : "1.0.5" - } - }, { "identity" : "firebase-ios-sdk", "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { - "revision" : "fdc352fabaf5916e7faa1f96ad02b1957e93e5a5", - "version" : "11.15.0" + "revision" : "b9bf3adac18e6e3059167194aeb632f15a5ba4b2", + "version" : "12.1.0" } }, { @@ -51,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk", "state" : { - "revision" : "973bd67929bfbe465f63c05cd5a4b113765fbc7f", - "version" : "2.2.1" + "revision" : "e15f979c3eaf477d24e5bfec9d87f1d76fbac297", + "version" : "2.2.0" } }, { @@ -60,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "45ce435e9406d3c674dd249a042b932bee006f60", - "version" : "11.15.0" + "revision" : "883305109ead4599e4ca59591754ee72e81e6b5e", + "version" : "12.1.0" } }, { diff --git a/brainwallet.xcodeproj/project.pbxproj b/brainwallet.xcodeproj/project.pbxproj index c491de0d..e7a997db 100644 --- a/brainwallet.xcodeproj/project.pbxproj +++ b/brainwallet.xcodeproj/project.pbxproj @@ -56,6 +56,12 @@ 244A8D932DE84C890024D356 /* BrainwalletShapes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 244A8D922DE84C7F0024D356 /* BrainwalletShapes.swift */; }; 245A91DC2DBA3E670048E3A6 /* PINRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 245A91DB2DBA3E450048E3A6 /* PINRowView.swift */; }; 245F189C2DD1F28B00D20715 /* BuyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 245F189B2DD1F27E00D20715 /* BuyViewModel.swift */; }; + 2460284F2E5F178400CDEB7A /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 2460284E2E5F178400CDEB7A /* FirebaseAnalytics */; }; + 246028512E5F178400CDEB7A /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 246028502E5F178400CDEB7A /* FirebaseCrashlytics */; }; + 246028532E5F178400CDEB7A /* FirebaseInAppMessaging-Beta in Frameworks */ = {isa = PBXBuildFile; productRef = 246028522E5F178400CDEB7A /* FirebaseInAppMessaging-Beta */; }; + 246028552E5F178400CDEB7A /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 246028542E5F178400CDEB7A /* FirebaseMessaging */; }; + 246028572E5F178400CDEB7A /* FirebasePerformance in Frameworks */ = {isa = PBXBuildFile; productRef = 246028562E5F178400CDEB7A /* FirebasePerformance */; }; + 246028592E5F178400CDEB7A /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 246028582E5F178400CDEB7A /* FirebaseRemoteConfig */; }; 2461418F2DA9B7AF007BB116 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2461418E2DA9B7AF007BB116 /* LaunchScreen.storyboard */; }; 24618EEA2D90436500A878AC /* BRCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24618EE92D90435200A878AC /* BRCore.swift */; }; 246A9A072DF5F54C002480CB /* Utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 246A9A062DF5F532002480CB /* Utility.swift */; }; @@ -106,7 +112,6 @@ 24BC37C02E22B249005DD3AC /* coinflip.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 24BC37BF2E22B249005DD3AC /* coinflip.mp3 */; }; 24BEBB972DCDE4D4001E1F1F /* (null) in Frameworks */ = {isa = PBXBuildFile; }; 24BEC6072DF0B53000140AAD /* WipeWalletView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24BEC6062DF0B52600140AAD /* WipeWalletView.swift */; }; - 24BEF7E12DCCCD6C00CA2EEC /* BrainwalletiOSStorekit in Frameworks */ = {isa = PBXBuildFile; productRef = 24BEF7E02DCCCD6C00CA2EEC /* BrainwalletiOSStorekit */; }; 24C639CE2DC6D5F60014E6DD /* TransactionRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C639CD2DC6D5E70014E6DD /* TransactionRowView.swift */; }; 24C6D2D42E1D6B150096AD62 /* SeedWordPileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C6D2D32E1D6B030096AD62 /* SeedWordPileView.swift */; }; 24C6D2D62E1D9C4E0096AD62 /* SeedWordDragView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C6D2D52E1D9C4E0096AD62 /* SeedWordDragView.swift */; }; @@ -401,10 +406,6 @@ C312D4CF2D7DC27700BB97A4 /* BarlowSemiCondensed-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C312D0952D7DC27700BB97A4 /* BarlowSemiCondensed-SemiBold.ttf */; }; C32369FF2D7DD431007039A1 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C32369FE2D7DD431007039A1 /* LoginViewController.swift */; }; C3236A012D7DE355007039A1 /* URLController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3236A002D7DE34D007039A1 /* URLController.swift */; }; - C353582D2D11DA4900395C45 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = C353582C2D11DA4900395C45 /* FirebaseRemoteConfig */; }; - C35C1220293D464A0009022D /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = C35C121F293D464A0009022D /* FirebaseAnalytics */; }; - C35C1222293D464A0009022D /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = C35C1221293D464A0009022D /* FirebaseAuth */; }; - C35C1224293D464A0009022D /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = C35C1223293D464A0009022D /* FirebaseCrashlytics */; }; C35C122A293D48340009022D /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = C35C1229293D48340009022D /* KeychainAccess */; }; /* End PBXBuildFile section */ @@ -1022,20 +1023,21 @@ buildActionMask = 2147483647; files = ( 24BEBB972DCDE4D4001E1F1F /* (null) in Frameworks */, + 246028532E5F178400CDEB7A /* FirebaseInAppMessaging-Beta in Frameworks */, 24D91D0B2166923E0077A619 /* UserNotifications.framework in Frameworks */, + 2460284F2E5F178400CDEB7A /* FirebaseAnalytics in Frameworks */, + 246028592E5F178400CDEB7A /* FirebaseRemoteConfig in Frameworks */, 24F64C1E2DAFBD0F001DC9B6 /* Lottie in Frameworks */, C35C122A293D48340009022D /* KeychainAccess in Frameworks */, + 246028572E5F178400CDEB7A /* FirebasePerformance in Frameworks */, 249C45E02D9415D900E9C3B0 /* AppsFlyerLib in Frameworks */, 22A9A9661DF61FEE000F0016 /* WebKit.framework in Frameworks */, - C353582D2D11DA4900395C45 /* FirebaseRemoteConfig in Frameworks */, 22A9A9641DF61FE7000F0016 /* Security.framework in Frameworks */, 22A9A9621DF61FE0000F0016 /* SystemConfiguration.framework in Frameworks */, + 246028512E5F178400CDEB7A /* FirebaseCrashlytics in Frameworks */, 22A9A9601DF61FD8000F0016 /* CoreLocation.framework in Frameworks */, + 246028552E5F178400CDEB7A /* FirebaseMessaging in Frameworks */, 22A9A95E1DF61FD0000F0016 /* PushKit.framework in Frameworks */, - 24BEF7E12DCCCD6C00CA2EEC /* BrainwalletiOSStorekit in Frameworks */, - C35C1222293D464A0009022D /* FirebaseAuth in Frameworks */, - C35C1224293D464A0009022D /* FirebaseCrashlytics in Frameworks */, - C35C1220293D464A0009022D /* FirebaseAnalytics in Frameworks */, 759DA0BE1DAC36A3008CC49B /* libBRCore.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2143,14 +2145,15 @@ ); name = brainwallet; packageProductDependencies = ( - C35C121F293D464A0009022D /* FirebaseAnalytics */, - C35C1221293D464A0009022D /* FirebaseAuth */, - C35C1223293D464A0009022D /* FirebaseCrashlytics */, C35C1229293D48340009022D /* KeychainAccess */, - C353582C2D11DA4900395C45 /* FirebaseRemoteConfig */, 249C45DF2D9415D900E9C3B0 /* AppsFlyerLib */, 24F64C1D2DAFBD0F001DC9B6 /* Lottie */, - 24BEF7E02DCCCD6C00CA2EEC /* BrainwalletiOSStorekit */, + 2460284E2E5F178400CDEB7A /* FirebaseAnalytics */, + 246028502E5F178400CDEB7A /* FirebaseCrashlytics */, + 246028522E5F178400CDEB7A /* FirebaseInAppMessaging-Beta */, + 246028542E5F178400CDEB7A /* FirebaseMessaging */, + 246028562E5F178400CDEB7A /* FirebasePerformance */, + 246028582E5F178400CDEB7A /* FirebaseRemoteConfig */, ); productName = breadwallet; productReference = 75A2A7901DA5934300A983D8 /* Brainwallet.app */; @@ -2232,11 +2235,10 @@ ); mainGroup = 75A2A7871DA5934300A983D8; packageReferences = ( - C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, C35C1228293D48330009022D /* XCRemoteSwiftPackageReference "KeychainAccess" */, 249C45DE2D9415D900E9C3B0 /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */, 24F64C1C2DAFBD0F001DC9B6 /* XCRemoteSwiftPackageReference "lottie-ios" */, - 24BEF7DF2DCCCD6C00CA2EEC /* XCRemoteSwiftPackageReference "BrainwalletiOSStorekit" */, + 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, ); preferredProjectObjectVersion = 77; productRefGroup = 75A2A7911DA5934300A983D8 /* Products */; @@ -3353,20 +3355,20 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 249C45DE2D9415D900E9C3B0 /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */ = { + 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/AppsFlyerSDK/AppsFlyerFramework"; + repositoryURL = "https://github.com/firebase/firebase-ios-sdk"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 6.16.1; + kind = exactVersion; + version = 12.1.0; }; }; - 24BEF7DF2DCCCD6C00CA2EEC /* XCRemoteSwiftPackageReference "BrainwalletiOSStorekit" */ = { + 249C45DE2D9415D900E9C3B0 /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */ = { isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/gruntsoftware/BrainwalletiOSStorekit.git"; + repositoryURL = "https://github.com/AppsFlyerSDK/AppsFlyerFramework"; requirement = { - kind = upToNextMinorVersion; - minimumVersion = 1.0.0; + kind = upToNextMajorVersion; + minimumVersion = 6.16.1; }; }; 24F64C1C2DAFBD0F001DC9B6 /* XCRemoteSwiftPackageReference "lottie-ios" */ = { @@ -3377,14 +3379,6 @@ version = 4.5.1; }; }; - C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/firebase/firebase-ios-sdk.git"; - requirement = { - kind = exactVersion; - version = 11.15.0; - }; - }; C35C1228293D48330009022D /* XCRemoteSwiftPackageReference "KeychainAccess" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess.git"; @@ -3396,40 +3390,45 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 249C45DF2D9415D900E9C3B0 /* AppsFlyerLib */ = { + 2460284E2E5F178400CDEB7A /* FirebaseAnalytics */ = { isa = XCSwiftPackageProductDependency; - package = 249C45DE2D9415D900E9C3B0 /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */; - productName = AppsFlyerLib; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseAnalytics; }; - 24BEF7E02DCCCD6C00CA2EEC /* BrainwalletiOSStorekit */ = { + 246028502E5F178400CDEB7A /* FirebaseCrashlytics */ = { isa = XCSwiftPackageProductDependency; - package = 24BEF7DF2DCCCD6C00CA2EEC /* XCRemoteSwiftPackageReference "BrainwalletiOSStorekit" */; - productName = BrainwalletiOSStorekit; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseCrashlytics; }; - 24F64C1D2DAFBD0F001DC9B6 /* Lottie */ = { + 246028522E5F178400CDEB7A /* FirebaseInAppMessaging-Beta */ = { isa = XCSwiftPackageProductDependency; - package = 24F64C1C2DAFBD0F001DC9B6 /* XCRemoteSwiftPackageReference "lottie-ios" */; - productName = Lottie; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = "FirebaseInAppMessaging-Beta"; }; - C353582C2D11DA4900395C45 /* FirebaseRemoteConfig */ = { + 246028542E5F178400CDEB7A /* FirebaseMessaging */ = { isa = XCSwiftPackageProductDependency; - package = C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseRemoteConfig; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseMessaging; }; - C35C121F293D464A0009022D /* FirebaseAnalytics */ = { + 246028562E5F178400CDEB7A /* FirebasePerformance */ = { isa = XCSwiftPackageProductDependency; - package = C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseAnalytics; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebasePerformance; }; - C35C1221293D464A0009022D /* FirebaseAuth */ = { + 246028582E5F178400CDEB7A /* FirebaseRemoteConfig */ = { isa = XCSwiftPackageProductDependency; - package = C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseAuth; + package = 2460284D2E5F178400CDEB7A /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; + productName = FirebaseRemoteConfig; }; - C35C1223293D464A0009022D /* FirebaseCrashlytics */ = { + 249C45DF2D9415D900E9C3B0 /* AppsFlyerLib */ = { isa = XCSwiftPackageProductDependency; - package = C35C121E293D464A0009022D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */; - productName = FirebaseCrashlytics; + package = 249C45DE2D9415D900E9C3B0 /* XCRemoteSwiftPackageReference "AppsFlyerFramework" */; + productName = AppsFlyerLib; + }; + 24F64C1D2DAFBD0F001DC9B6 /* Lottie */ = { + isa = XCSwiftPackageProductDependency; + package = 24F64C1C2DAFBD0F001DC9B6 /* XCRemoteSwiftPackageReference "lottie-ios" */; + productName = Lottie; }; C35C1229293D48340009022D /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; diff --git a/brainwallet/App Launch Classes/AppDelegate.swift b/brainwallet/App Launch Classes/AppDelegate.swift index 2e9fb935..51b74e73 100644 --- a/brainwallet/App Launch Classes/AppDelegate.swift +++ b/brainwallet/App Launch Classes/AppDelegate.swift @@ -1,4 +1,5 @@ import AppsFlyerLib +import FirebaseMessaging import Firebase import FirebaseCore import FirebaseAnalytics @@ -7,39 +8,14 @@ import SwiftUI import UIKit @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { +class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate { var window: UIWindow? var applicationController = ApplicationController() var remoteConfigurationHelper: RemoteConfigHelper? - var resourceRequest: NSBundleResourceRequest? func application(_ application: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - preSetupSteps() - - // Wipe restart - // Register for system notifications - NotificationCenter.default.addObserver( - self, - selector: #selector(restartAfterWipedWallet), - name: .didDeleteWalletDBNotification, - object: nil - ) - - // Set User theme preference - // Register for system notifications - NotificationCenter.default.addObserver( - self, - selector: #selector(updateUserThemePreference), - name: .changedThemePreferenceNotification, - object: nil - ) - return true - } - - private func preSetupSteps() { - // Locale and fetch access // DEV: Break here to test Locale/Matrix @@ -76,14 +52,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Remote Config self.remoteConfigurationHelper = RemoteConfigHelper.sharedInstance - let current = UNUserNotificationCenter.current() - current.getNotificationSettings(completionHandler: { settings in + Messaging.messaging().delegate = self + UNUserNotificationCenter.current().delegate = self - debugPrint(settings.debugDescription) - if settings.authorizationStatus == .denied {} - }) + let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] + UNUserNotificationCenter.current().requestAuthorization(options: authOptions, completionHandler: { _, _ in }) - guard let thisWindow = window else { return } + application.registerForRemoteNotifications() + + // Wipe restart + // Register for system notifications + NotificationCenter.default.addObserver( + self, + selector: #selector(restartAfterWipedWallet), + name: .didDeleteWalletDBNotification, + object: nil + ) + + // Set User theme preference + // Register for system notifications + NotificationCenter.default.addObserver( + self, + selector: #selector(updateUserThemePreference), + name: .changedThemePreferenceNotification, + object: nil + ) + + guard let thisWindow = window else { return false } // Set global themes thisWindow.overrideUserInterfaceStyle = UserDefaults.userPreferredDarkTheme ? .dark: .light @@ -94,6 +89,40 @@ class AppDelegate: UIResponder, UIApplicationDelegate { 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 ?? ""] + NotificationCenter.default.post(name: Notification.Name("FCMToken"), object: nil, userInfo: dataDict) + + // Messaging topic subscription + if let localeIdentifier = Locale.current.identifier as String?, + (fcmToken != nil) { + let localePrefix: String = localeIdentifier.components(separatedBy: "_").first ?? "en" + let initialTopic: String = "initial_\(localePrefix)" + let promoTopic: String = "promo_\(localePrefix)" + let newsTopic: String = "news_\(localePrefix)" + let warnTopic: String = "warn_\(localePrefix)" + + let topicsArray: [String] = [initialTopic, promoTopic, newsTopic, warnTopic] + debugPrint("::: fcmToken: \(String(describing: fcmToken))") + topicsArray.forEach { topic in + Messaging.messaging().subscribe(toTopic: topic) { error in + if error != nil { + Analytics + .logEvent("fcm_messaging_subscription_error", + parameters: [ + "platform": "ios", + "app_version": AppVersion.string, + "error": "topic \(topic) \(String(describing: error))" + ]) + } + } + } + } } func applicationDidBecomeActive(_: UIApplication) { @@ -125,10 +154,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } - func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken _: Data) { } + func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + Messaging.messaging().apnsToken = deviceToken + } - func application(_: UIApplication, didReceiveRemoteNotification _: [AnyHashable: Any], - fetchCompletionHandler _: @escaping (UIBackgroundFetchResult) -> Void) {} + func application(_: UIApplication, didReceiveRemoteNotification remoteNotificationDictionary: [AnyHashable: Any], + fetchCompletionHandler _: @escaping (UIBackgroundFetchResult) -> Void) { + debugPrint("++++ did receive rn \(remoteNotificationDictionary.debugDescription)") + } @objc private func restartAfterWipedWallet() { @@ -142,7 +175,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Clear the root view controller thisWindow.rootViewController = nil - self.preSetupSteps() + + /// TBD to restart the app } } @@ -164,18 +198,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate { if let fboptions = FirebaseOptions(contentsOfFile: filePath) { FirebaseApp.configure(options: fboptions) -// #if DEBUG -// Analytics.setUserProperty("debug_mode", forName: "debug_enabled") -// -// /// Notfy the Firebase Console for monitoring and debugging -// Analytics -// .logEvent("debug_mode_launched", -// parameters: [ -// "platform": "ios", -// "app_version": AppVersion.string, -// "device": UIDevice.current.model -// ]) -// #endif + // #if DEBUG + // Analytics.setUserProperty("debug_mode", forName: "debug_enabled") + // + // /// Notfy the Firebase Console for monitoring and debugging + // Analytics + // .logEvent("debug_mode_launched", + // parameters: [ + // "platform": "ios", + // "app_version": AppVersion.string, + // "device": UIDevice.current.model + // ]) + // #endif + } else { Analytics.logEvent("error_message", parameters: [ "firebase_config_failed": "launch_error" diff --git a/brainwallet/Info.plist b/brainwallet/Info.plist index 2be565e9..47eb1e52 100644 --- a/brainwallet/Info.plist +++ b/brainwallet/Info.plist @@ -2,6 +2,8 @@ + FirebaseAppDelegateProxyEnabled + BGTaskSchedulerPermittedIdentifiers ltd.grunt.brainwallet @@ -47,12 +49,24 @@ NSExceptionDomains - NSExceptionRequiresForwardSecrecy - + NSExceptionRequiresForwardSecrecy + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + NSIncludesSubdomains app-analytics-services.com + brainwallet.co + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + firebaseremoteconfig.googleapis.com NSExceptionAllowsInsecureHTTPLoads @@ -67,6 +81,13 @@ NSIncludesSubdomains + gruntsoftware.com + + NSExceptionAllowsInsecureHTTPLoads + + NSIncludesSubdomains + + NSCameraUsageDescription