diff --git a/.gitignore b/.gitignore index 2352e74d6..26d7c19cf 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ Packages/ Package.pins Package.resolved .build/ -/*.xcodeproj # Add this line if you want to avoid checking in Xcode SPM integration. .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata diff --git a/loafwallet.xcodeproj/project.pbxproj b/loafwallet.xcodeproj/project.pbxproj index cfd3c7118..3c2d4da61 100644 --- a/loafwallet.xcodeproj/project.pbxproj +++ b/loafwallet.xcodeproj/project.pbxproj @@ -82,7 +82,6 @@ 24470E2A23A5F33000ADDA27 /* BRReplicatedKVStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E2923A5F33000ADDA27 /* BRReplicatedKVStoreTests.swift */; }; 24470E2C23A5F43B00ADDA27 /* DefaultFiatCurrencyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E2B23A5F43B00ADDA27 /* DefaultFiatCurrencyTests.swift */; }; 24470E2E23A5F4FF00ADDA27 /* BRCoderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E2D23A5F4FF00ADDA27 /* BRCoderTests.swift */; }; - 24470E3023A5F55700ADDA27 /* BRHTTPServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E2F23A5F55700ADDA27 /* BRHTTPServerTests.swift */; }; 24470E3223A5F5B100ADDA27 /* NSDataExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E3123A5F5B100ADDA27 /* NSDataExtensionTests.swift */; }; 24470E3423A5F5E600ADDA27 /* PaymentRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E3323A5F5E600ADDA27 /* PaymentRequestTests.swift */; }; 24470E3623A5FDE800ADDA27 /* PhraseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24470E3523A5FDE800ADDA27 /* PhraseTests.swift */; }; @@ -123,7 +122,6 @@ 24D91D0B2166923E0077A619 /* UserNotifications.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24D91D0A2166923E0077A619 /* UserNotifications.framework */; }; 24DFCE6823B89CDE001F17F8 /* Settings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 24DFCE6723B89CDE001F17F8 /* Settings.storyboard */; }; 28444E99F1C17FA0065EBE35 /* Pods_loafwallet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47013A7996D32E67CB239C06 /* Pods_loafwallet.framework */; }; - 375DDB3E2697C253005E2B27 /* partner-keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 375DDB3C2697C253005E2B27 /* partner-keys.plist */; }; 375DDB3F2697C253005E2B27 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 375DDB3D2697C253005E2B27 /* GoogleService-Info.plist */; }; 7503773D1DF57428005EB8AE /* WalletManager+Auth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7503773C1DF57428005EB8AE /* WalletManager+Auth.swift */; }; 751734B91DAC941E00193C87 /* sec-sub-1.c in Sources */ = {isa = PBXBuildFile; fileRef = 755CD8BE1DAA16820075898E /* sec-sub-1.c */; }; @@ -268,7 +266,6 @@ C30AFB642598FFB200CDCF69 /* PartnerAPIManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C30AFB632598FFB200CDCF69 /* PartnerAPIManager.swift */; }; C316CF49261887FC00E4C09B /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C316CF48261887FC00E4C09B /* UIApplication+Extension.swift */; }; C3188E2726431E750008ADD1 /* Debug-GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C3188E2526431E750008ADD1 /* Debug-GoogleService-Info.plist */; }; - C3188E2826431E750008ADD1 /* debug-partner-keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = C3188E2626431E750008ADD1 /* debug-partner-keys.plist */; }; C3188E3326445EA20008ADD1 /* FileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3188E3226445EA20008ADD1 /* FileTests.swift */; }; C31891C1267338D300ECE25C /* NonUSTabBarViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31891C0267338D300ECE25C /* NonUSTabBarViewControllerTests.swift */; }; C31891C326733FD400ECE25C /* TabBarViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C31891C226733FD400ECE25C /* TabBarViewControllerTests.swift */; }; @@ -300,6 +297,8 @@ C361F48228B368BC00E9798F /* AddressFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C361F48128B368BC00E9798F /* AddressFieldView.swift */; }; C36375A328BD38A500CFB3D8 /* SendButtonHostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36375A228BD38A500CFB3D8 /* SendButtonHostingController.swift */; }; C36375A528BD390C00CFB3D8 /* SendButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36375A428BD390C00CFB3D8 /* SendButtonView.swift */; }; + C36DBF5F28F18D2C00FBCB24 /* LocalWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36DBF5E28F18D2C00FBCB24 /* LocalWebView.swift */; }; + C36DBF6128F1988900FBCB24 /* LocalWebViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C36DBF6028F1988900FBCB24 /* LocalWebViewModel.swift */; }; C377519926B09A3400E1FB12 /* TransferringView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C377519826B09A3400E1FB12 /* TransferringView.swift */; }; C377519B26B0A3D900E1FB12 /* TransferringViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C377519A26B0A3D900E1FB12 /* TransferringViewModel.swift */; }; C379F228259B9BF000B25883 /* RegistrationAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C379F227259B9BF000B25883 /* RegistrationAlertView.swift */; }; @@ -799,7 +798,6 @@ 24470E2923A5F33000ADDA27 /* BRReplicatedKVStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRReplicatedKVStoreTests.swift; sourceTree = ""; }; 24470E2B23A5F43B00ADDA27 /* DefaultFiatCurrencyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFiatCurrencyTests.swift; sourceTree = ""; }; 24470E2D23A5F4FF00ADDA27 /* BRCoderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRCoderTests.swift; sourceTree = ""; }; - 24470E2F23A5F55700ADDA27 /* BRHTTPServerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRHTTPServerTests.swift; sourceTree = ""; }; 24470E3123A5F5B100ADDA27 /* NSDataExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSDataExtensionTests.swift; sourceTree = ""; }; 24470E3323A5F5E600ADDA27 /* PaymentRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentRequestTests.swift; sourceTree = ""; }; 24470E3523A5FDE800ADDA27 /* PhraseTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhraseTests.swift; sourceTree = ""; }; @@ -854,7 +852,6 @@ 24D91D0D2166A5480077A619 /* TestnetData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestnetData.swift; sourceTree = ""; }; 24DFCE6723B89CDE001F17F8 /* Settings.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Settings.storyboard; sourceTree = ""; }; 3058D709119F89F54447395D /* Pods_loafwalletTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_loafwalletTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 375DDB3C2697C253005E2B27 /* partner-keys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "partner-keys.plist"; sourceTree = ""; }; 375DDB3D2697C253005E2B27 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 47013A7996D32E67CB239C06 /* Pods_loafwallet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_loafwallet.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6C3B4621CCAC54A4057653A5 /* Pods-loafwallet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-loafwallet.release.xcconfig"; path = "Target Support Files/Pods-loafwallet/Pods-loafwallet.release.xcconfig"; sourceTree = ""; }; @@ -1461,7 +1458,6 @@ C30AFB632598FFB200CDCF69 /* PartnerAPIManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartnerAPIManager.swift; sourceTree = ""; }; C316CF48261887FC00E4C09B /* UIApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = ""; }; C3188E2526431E750008ADD1 /* Debug-GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Debug-GoogleService-Info.plist"; sourceTree = ""; }; - C3188E2626431E750008ADD1 /* debug-partner-keys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "debug-partner-keys.plist"; sourceTree = ""; }; C3188E3226445EA20008ADD1 /* FileTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileTests.swift; sourceTree = ""; }; C31891C0267338D300ECE25C /* NonUSTabBarViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NonUSTabBarViewControllerTests.swift; sourceTree = ""; }; C31891C226733FD400ECE25C /* TabBarViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarViewControllerTests.swift; sourceTree = ""; }; @@ -1497,6 +1493,8 @@ C361F48128B368BC00E9798F /* AddressFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddressFieldView.swift; sourceTree = ""; }; C36375A228BD38A500CFB3D8 /* SendButtonHostingController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendButtonHostingController.swift; sourceTree = ""; }; C36375A428BD390C00CFB3D8 /* SendButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendButtonView.swift; sourceTree = ""; }; + C36DBF5E28F18D2C00FBCB24 /* LocalWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebView.swift; sourceTree = ""; }; + C36DBF6028F1988900FBCB24 /* LocalWebViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebViewModel.swift; sourceTree = ""; }; C377519826B09A3400E1FB12 /* TransferringView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferringView.swift; sourceTree = ""; }; C377519A26B0A3D900E1FB12 /* TransferringViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransferringViewModel.swift; sourceTree = ""; }; C379F227259B9BF000B25883 /* RegistrationAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationAlertView.swift; sourceTree = ""; }; @@ -2190,7 +2188,6 @@ 24470E2D23A5F4FF00ADDA27 /* BRCoderTests.swift */, 24470E2923A5F33000ADDA27 /* BRReplicatedKVStoreTests.swift */, 24470E2B23A5F43B00ADDA27 /* DefaultFiatCurrencyTests.swift */, - 24470E2F23A5F55700ADDA27 /* BRHTTPServerTests.swift */, 24470E3123A5F5B100ADDA27 /* NSDataExtensionTests.swift */, 24470E3523A5FDE800ADDA27 /* PhraseTests.swift */, 24470E3323A5F5E600ADDA27 /* PaymentRequestTests.swift */, @@ -3020,9 +3017,7 @@ isa = PBXGroup; children = ( 375DDB3D2697C253005E2B27 /* GoogleService-Info.plist */, - 375DDB3C2697C253005E2B27 /* partner-keys.plist */, C3188E2526431E750008ADD1 /* Debug-GoogleService-Info.plist */, - C3188E2626431E750008ADD1 /* debug-partner-keys.plist */, C35ABD07257404C6002BB9BB /* SwiftUI+UIKit */, 75A2A87C1DA59E4E00A983D8 /* loafwallet.entitlements */, 75A2A7931DA5934300A983D8 /* AppDelegate.swift */, @@ -3451,6 +3446,8 @@ 2494037C23AE0C7100369261 /* SyncProgressHeaderView.swift */, C32DC79B2593971500A7FDB4 /* CardView.swift */, C3EB6C1A26C18DD500881841 /* Enter2FACodeView.swift */, + C36DBF5E28F18D2C00FBCB24 /* LocalWebView.swift */, + C36DBF6028F1988900FBCB24 /* LocalWebViewModel.swift */, ); name = Views; sourceTree = ""; @@ -3990,7 +3987,6 @@ CE5E6C9A1EB9135000A476DB /* Icon.xcassets in Resources */, 24D5F25022599C0B00225462 /* BarlowSemiCondensed-Light.ttf in Resources */, 2494037F23AE0C7100369261 /* SyncProgressHeaderView.xib in Resources */, - 375DDB3E2697C253005E2B27 /* partner-keys.plist in Resources */, C3188E2726431E750008ADD1 /* Debug-GoogleService-Info.plist in Resources */, CE29901A1EFD6DE50093A0F2 /* Localizable.strings in Resources */, 24313C9F23824F5800A83F69 /* Animate.storyboard in Resources */, @@ -4003,7 +3999,6 @@ 24DFCE6823B89CDE001F17F8 /* Settings.storyboard in Resources */, 24393B5C23C259400075218D /* Phrase.storyboard in Resources */, 24313CA723824F5800A83F69 /* Card.storyboard in Resources */, - C3188E2826431E750008ADD1 /* debug-partner-keys.plist in Resources */, 75A2A79B1DA5934300A983D8 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -4149,7 +4144,6 @@ 24470E2523A5EF0D00ADDA27 /* BRAPIClientTests.swift in Sources */, C31891C326733FD400ECE25C /* TabBarViewControllerTests.swift in Sources */, 24470E3C23A5FFD700ADDA27 /* TouchIdEnabledTests.swift in Sources */, - 24470E3023A5F55700ADDA27 /* BRHTTPServerTests.swift in Sources */, 24470E3A23A5FF5700ADDA27 /* TestHelpers.swift in Sources */, C345D83725A8D57E00657E30 /* AnimatedCardViewModelTests.swift in Sources */, C345D82525A8D54200657E30 /* RegistrationViewModelTests.swift in Sources */, @@ -4331,6 +4325,7 @@ 7528D2981ECF655500925DBC /* PaymentProtocol.swift in Sources */, 22A9A9491DF61945000F0016 /* BRBSPatch.swift in Sources */, C3543A27264AFE490005D17A /* LocaleChangeView.swift in Sources */, + C36DBF6128F1988900FBCB24 /* LocalWebViewModel.swift in Sources */, 24A6DCFC2230BD9000505F44 /* WipeEmptyWalletViewController.swift in Sources */, CE92F9F61DEDF6890046B516 /* UIViewControllerContextTransitioning+BRAdditions.swift in Sources */, CEA362681E00EE320061FC0E /* CameraGuideView.swift in Sources */, @@ -4427,6 +4422,7 @@ C354C4632590059500675E0E /* TransactionsViewModel.swift in Sources */, CEF3D2DB1E8B55C80070178E /* UISlider+Gradient.swift in Sources */, C32DAE0725925B7E003FC978 /* Color+Extension.swift in Sources */, + C36DBF5F28F18D2C00FBCB24 /* LocalWebView.swift in Sources */, C3EB6C1B26C18DD500881841 /* Enter2FACodeView.swift in Sources */, CEC6AA4B1DEFD24C00EE5AFD /* MenuButtonType.swift in Sources */, C3BD4A6A2597E1E900D97079 /* CardLoggedInView.swift in Sources */, @@ -4827,7 +4823,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = loafwallet/loafwallet.entitlements; - CURRENT_PROJECT_VERSION = 153; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ZV7987N2ZC; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -4842,7 +4838,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.9.0; + MARKETING_VERSION = 3.10.0; OTHER_SWIFT_FLAGS = "-DDebug $(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet; PRODUCT_MODULE_NAME = loafwallet; @@ -4935,7 +4931,7 @@ CODE_SIGN_ENTITLEMENTS = TodayExtension/TodayExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ZV7987N2ZC; INFOPLIST_FILE = TodayExtension/Info.plist; @@ -4945,7 +4941,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = 3.10.0; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -5247,7 +5243,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = loafwallet/loafwallet.entitlements; - CURRENT_PROJECT_VERSION = 153; + CURRENT_PROJECT_VERSION = 380; DEVELOPMENT_TEAM = ZV7987N2ZC; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; FRAMEWORK_SEARCH_PATHS = ( @@ -5261,7 +5257,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.9.0; + MARKETING_VERSION = 3.10.0; OTHER_SWIFT_FLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet; PRODUCT_MODULE_NAME = loafwallet; @@ -5278,7 +5274,7 @@ CODE_SIGN_ENTITLEMENTS = TodayExtension/TodayExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 380; DEVELOPMENT_TEAM = ZV7987N2ZC; INFOPLIST_FILE = TodayExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -5287,7 +5283,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = 3.10.0; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -5379,7 +5375,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = loafwallet/loafwallet.entitlements; - CURRENT_PROJECT_VERSION = 153; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ZV7987N2ZC; FRAMEWORK_SEARCH_PATHS = ( @@ -5393,7 +5389,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 3.9.0; + MARKETING_VERSION = 3.10.0; OTHER_SWIFT_FLAGS = "-DDebug -DTestnet $(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet; PRODUCT_MODULE_NAME = loafwallet; @@ -5411,7 +5407,7 @@ CODE_SIGN_ENTITLEMENTS = TodayExtension/TodayExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 380; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ZV7987N2ZC; INFOPLIST_FILE = TodayExtension/Info.plist; @@ -5421,7 +5417,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.6.1; + MARKETING_VERSION = 3.10.0; PRODUCT_BUNDLE_IDENTIFIER = com.litecoin.loafwallet.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/Contents.json b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/Contents.json index 84b920d9c..9dbfa549c 100644 --- a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/Contents.json +++ b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "bitrefill-logo-app.png", "idiom" : "universal", - "filename" : "bitrefill@1x.png", "scale" : "1x" }, { @@ -11,12 +11,11 @@ }, { "idiom" : "universal", - "filename" : "bitrefill@3x.png", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill-logo-app.png b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill-logo-app.png new file mode 100644 index 000000000..5f03b3e65 Binary files /dev/null and b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill-logo-app.png differ diff --git a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@1x.png b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@1x.png deleted file mode 100644 index 8436b465f..000000000 Binary files a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@1x.png and /dev/null differ diff --git a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@3x.png b/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@3x.png deleted file mode 100644 index 8436b465f..000000000 Binary files a/loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@3x.png and /dev/null differ diff --git a/loafwallet/BuyTableViewController.swift b/loafwallet/BuyTableViewController.swift index 8893046b3..b94650c71 100644 --- a/loafwallet/BuyTableViewController.swift +++ b/loafwallet/BuyTableViewController.swift @@ -8,9 +8,28 @@ import UIKit import SafariServices +import WebKit +import SwiftUI class BuyTableViewController: UITableViewController, SFSafariViewControllerDelegate { + @IBOutlet weak var bitrefillLogoImageView: UIImageView! + @IBOutlet weak var bitrefillHeaderLabel: UILabel! + @IBOutlet weak var bitrefillDetailsLabel: UILabel! + @IBOutlet weak var bitrefillCellContainerView: UIView! + + @IBAction func didTapBitrefill(_ sender: UIButton) { + + guard let url = URL(string: "https://www.bitrefill.com/?ref=bAshL935") else + { + return + } + + let sfSafariVC = SFSafariViewController(url: url) + sfSafariVC.delegate = self + present(sfSafariVC, animated: true) + } + //MARK: Moonpay UI @IBOutlet weak var moonpayLogoImageView: UIImageView! @IBOutlet weak var moonpayHeaderLabel: UILabel! @@ -94,9 +113,18 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg setupWkVCData() } - private func setupWkVCData() { + private func setupWkVCData() { + + let bitrefillData = Partner.partnerDataArray()[0] + bitrefillLogoImageView.image = bitrefillData.logo + bitrefillHeaderLabel.text = bitrefillData.headerTitle + bitrefillDetailsLabel.text = bitrefillData.details + bitrefillCellContainerView.layer.cornerRadius = 6.0 + bitrefillCellContainerView.layer.borderColor = UIColor.white.cgColor + bitrefillCellContainerView.layer.borderWidth = 1.0 + bitrefillCellContainerView.clipsToBounds = true - let moonpayData = Partner.partnerDataArray()[0] + let moonpayData = Partner.partnerDataArray()[1] moonpayLogoImageView.image = moonpayData.logo moonpayHeaderLabel.text = moonpayData.headerTitle moonpayDetailsLabel.text = moonpayData.details @@ -105,7 +133,7 @@ class BuyTableViewController: UITableViewController, SFSafariViewControllerDeleg moonpayCellContainerView.layer.borderWidth = 1.0 moonpayCellContainerView.clipsToBounds = true - let simplexData = Partner.partnerDataArray()[1] + let simplexData = Partner.partnerDataArray()[2] simplexLogoImageView.image = simplexData.logo simplexHeaderLabel.text = simplexData.headerTitle simplexDetailsLabel.text = simplexData.details diff --git a/loafwallet/LocalWebView.swift b/loafwallet/LocalWebView.swift new file mode 100644 index 000000000..aa3fdbd0d --- /dev/null +++ b/loafwallet/LocalWebView.swift @@ -0,0 +1,99 @@ +// +// LocalWebView.swift +// loafwallet +// +// Created by Kerry Washington on 10/8/22. +// Copyright © 2022 Litecoin Foundation. All rights reserved. +// + +import Foundation +import UIKit +import SwiftUI +import WebKit +import Combine + +// MARK: - WebViewHandlerDelegate +protocol WebViewHandlerDelegate { +} + +struct LocalWebView: UIViewRepresentable, WebViewHandlerDelegate { + + @ObservedObject + var viewModel: LocalWebViewModel + + func makeCoordinator() -> Coordinator { + Coordinator(self) + } + + func makeUIView(context: Context) -> WKWebView { + + let preferences = WKPreferences() + preferences.javaScriptCanOpenWindowsAutomatically = true + + let configuration = WKWebViewConfiguration() + configuration.preferences = preferences + + let webView = WKWebView(frame: CGRect.zero, configuration: configuration) + webView.navigationDelegate = context.coordinator + webView.allowsBackForwardNavigationGestures = false + webView.scrollView.isScrollEnabled = true + return webView + } + + func updateUIView(_ webView: WKWebView, context: Context) { + + if let url = Bundle.main.url(forResource: "bitrefill_index", withExtension: "html") { + webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) + } else { + NSLog("ERROR: Local html not found") + } + } + + class Coordinator : NSObject, WKNavigationDelegate { + var parent: LocalWebView + var delegate: WebViewHandlerDelegate? + var valueSubscriber: AnyCancellable? = nil + var webViewNavigationSubscriber: AnyCancellable? = nil + + init(_ uiWebView: LocalWebView) { + self.parent = uiWebView + self.delegate = parent + } + + deinit { + valueSubscriber?.cancel() + webViewNavigationSubscriber?.cancel() + } + + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { + + self.parent.viewModel.showLoader.send(false) + } + + //MARK: WKWebView's delegate functions + func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { + // Hides loader + parent.viewModel.showLoader.send(false) + } + + func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { + // Shows loader + parent.viewModel.showLoader.send(true) + } + + func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { + // Shows loader + parent.viewModel.showLoader.send(true) + } + + } +} + +// MARK: - Extensions +extension LocalWebView.Coordinator: WKScriptMessageHandler { + func userContentController(_ userContentController: WKUserContentController, + didReceive message: WKScriptMessage) { + } +} + + diff --git a/loafwallet/LocalWebViewModel.swift b/loafwallet/LocalWebViewModel.swift new file mode 100644 index 000000000..789e7f131 --- /dev/null +++ b/loafwallet/LocalWebViewModel.swift @@ -0,0 +1,12 @@ +// +// LocalWebViewModel.swift +// loafwallet + +import Foundation +import Combine + +class LocalWebViewModel: ObservableObject { + + var showLoader = PassthroughSubject() + var valuePublisher = PassthroughSubject() +} diff --git a/loafwallet/PartnerData.swift b/loafwallet/PartnerData.swift index 5355313e6..85fe07682 100644 --- a/loafwallet/PartnerData.swift +++ b/loafwallet/PartnerData.swift @@ -23,129 +23,13 @@ struct Partner { /// Fills partner data /// - Returns: Array of Partner Data static func partnerDataArray() -> [Partner] { + + let bitrefill = Partner(logo: UIImage(named: "bitrefillLogo")!, headerTitle: S.BuyCenter.Cells.bitrefillTitle, details: S.BuyCenter.Cells.bitrefillFinancialDetails) let moonpay = Partner(logo: UIImage(named: "moonpay-logo")!, headerTitle: S.BuyCenter.Cells.moonpayTitle, details: S.BuyCenter.Cells.moonpayFinancialDetails) let simplex = Partner(logo: UIImage(named: "simplexLogo")!, headerTitle: S.BuyCenter.Cells.simplexTitle, details: S.BuyCenter.Cells.simplexFinancialDetails) - return [moonpay, simplex] - } - - /// Returns Partner Key + URL - /// - Parameter name: Enum for the different partners - /// - Returns: Key string url - static func partnerKeyPathURL(name: PartnerName) -> String { - - /// Switch the config file based on the environment - var filePath: String - #if Release - - // Loads the release Partner Keys config file. - guard let releasePath = Bundle.main.path(forResource: "partner-keys", - ofType: "plist") else { - return "ERROR: FILE-NOT-FOUND" - } - filePath = releasePath - - #else - - // Loads the debug Partner Keys config file. - guard let debugPath = Bundle.main.path(forResource: "debug-partner-keys", - ofType: "plist") else { - return "ERROR: FILE-NOT-FOUND" - } - - filePath = debugPath - - #endif - - switch name { - - case .unstop: - - if let dictionary = NSDictionary(contentsOfFile: filePath) as? Dictionary, - let key = dictionary["infura-api"] as? String { - return "https://mainnet.infura.io/v3/" + key - } else { - - let errorDescription = "ERROR-INFURA_KEY" - LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription]) - return errorDescription - } - - case .changeNow: - - if let dictionary = NSDictionary(contentsOfFile: filePath) as? Dictionary, - let key = dictionary["change-now-api"] as? String { - return key - } else { - - let errorDescription = "ERROR-CHANGENOW_KEY" - LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription]) - return errorDescription - } - } - - } - - /// Returns Partner Key - /// - Parameter name: Enum for the different partners - /// - Returns: Key string - static func partnerKey(name: PartnerName) -> String { - - /// Switch the config file based on the environment - var filePath: String -#if Release - - // Loads the release Partner Keys config file. - guard let releasePath = Bundle.main.path(forResource: "partner-keys", - ofType: "plist") else { - return "ERROR: FILE-NOT-FOUND" - } - filePath = releasePath - -#else - - // Loads the debug Partner Keys config file. - guard let debugPath = Bundle.main.path(forResource: "debug-partner-keys", - ofType: "plist") else { - return "ERROR: FILE-NOT-FOUND" - } - - filePath = debugPath - -#endif - - switch name { - - case .unstop: - - if let dictionary = NSDictionary(contentsOfFile: filePath) as? Dictionary, - let key = dictionary["infura-api"] as? String { - return key - } else { - - let errorDescription = "ERROR-INFURA_KEY" - LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription]) - return errorDescription - } - - case .changeNow: - - if let dictionary = NSDictionary(contentsOfFile: filePath) as? Dictionary, - let key = dictionary["change-now-api"] as? String { - return key - } else { - - let errorDescription = "ERROR-CHANGENOW_KEY" - LWAnalytics.logEventWithParameters(itemName: ._20200112_ERR, properties: ["error": errorDescription]) - return errorDescription - } - } + return [bitrefill, moonpay, simplex] } - //TODO: Uncomment as integration progresses, kcw-grunt - // let bitrefillDictionary = - // ["title":S.BuyCenter.Cells.bitrefillTitle as AnyObject, - // "details":S.BuyCenter.Cells.bitrefillFinancialDetails, - // "logo":UIImage(named:"bitrefillLogo") ?? " ", - // "baseColor":#colorLiteral(red: 0.2235294118, green: 0.5490196078, blue: 0.9333333333, alpha: 1)] as [String : AnyObject] + } diff --git a/loafwallet/Storyboards/Buy.storyboard b/loafwallet/Storyboards/Buy.storyboard index ce4be875f..a7ecdc068 100644 --- a/loafwallet/Storyboards/Buy.storyboard +++ b/loafwallet/Storyboards/Buy.storyboard @@ -1,9 +1,9 @@ - + - + @@ -31,8 +31,8 @@ - - + + @@ -41,13 +41,13 @@ - - + @@ -72,7 +72,7 @@ @@ -112,8 +112,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -157,7 +238,7 @@ - + @@ -238,7 +319,7 @@ - + @@ -290,10 +371,14 @@ - - - - + + + + + + + + @@ -315,7 +400,7 @@ - +