From be3466368b4d46024eec79c1a2136e7437312f8a Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Fri, 4 Oct 2019 09:40:17 +0900 Subject: [PATCH] 2.6.1(4) --- GME Remit.xcodeproj/project.pbxproj | 8 +++-- GME Remit/AppDelegate.swift | 1 + .../View/SendMoneyReceiptViewController.swift | 8 +++++ .../SendMoneyVerificationViewController.swift | 24 ++++++++----- GME Remit/Utilities/Database/GMEDB.swift | 1 + GME Remit/Utilities/StoreReviewHelper.swift | 36 +++++++++++++++++++ fastlane/Fastfile | 4 +++ 7 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 GME Remit/Utilities/StoreReviewHelper.swift diff --git a/GME Remit.xcodeproj/project.pbxproj b/GME Remit.xcodeproj/project.pbxproj index d0c355d2..a5f48cce 100644 --- a/GME Remit.xcodeproj/project.pbxproj +++ b/GME Remit.xcodeproj/project.pbxproj @@ -110,6 +110,7 @@ 730197B422535135001954AB /* kycForm2ViewInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7301978822535135001954AB /* kycForm2ViewInterface.swift */; }; 730197B522535135001954AB /* kycForm2.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7301978922535135001954AB /* kycForm2.storyboard */; }; 730197B622535135001954AB /* kycForm2ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7301978A22535135001954AB /* kycForm2ViewController.swift */; }; + 7303E5732344A1F000472407 /* StoreReviewHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7303E5722344A1F000472407 /* StoreReviewHelper.swift */; }; 73071AAB2296BE6C008840FD /* HotLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73071AAA2296BE6C008840FD /* HotLine.swift */; }; 73071AC42296CF9B008840FD /* HotLineModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73071AB12296CF9B008840FD /* HotLineModuleInterface.swift */; }; 73071AC52296CF9B008840FD /* HotLineService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73071AB52296CF9B008840FD /* HotLineService.swift */; }; @@ -2381,6 +2382,7 @@ 7301978822535135001954AB /* kycForm2ViewInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = kycForm2ViewInterface.swift; sourceTree = ""; }; 7301978922535135001954AB /* kycForm2.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = kycForm2.storyboard; sourceTree = ""; }; 7301978A22535135001954AB /* kycForm2ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = kycForm2ViewController.swift; sourceTree = ""; }; + 7303E5722344A1F000472407 /* StoreReviewHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreReviewHelper.swift; sourceTree = ""; }; 73071AAA2296BE6C008840FD /* HotLine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HotLine.swift; sourceTree = ""; }; 73071AB12296CF9B008840FD /* HotLineModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HotLineModuleInterface.swift; sourceTree = ""; }; 73071AB52296CF9B008840FD /* HotLineService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HotLineService.swift; sourceTree = ""; }; @@ -11253,6 +11255,7 @@ 738F04B02316238600BA5EE7 /* ShadowView.swift */, 731703CB23221EA0005752DE /* SwipeNavigationController.swift */, 73976D212331BFB1003CF5E1 /* BankEnum.swift */, + 7303E5722344A1F000472407 /* StoreReviewHelper.swift */, ); path = Utilities; sourceTree = ""; @@ -14657,6 +14660,7 @@ BE74AFC3227C8FF200F05CE7 /* AddAccountViewController.swift in Sources */, D9A060DA223F680B00F5D7C4 /* ResendExchangeInteractor.swift in Sources */, 73B4C8C222A5F2440078D495 /* SelectCouponWireframe.swift in Sources */, + 7303E5732344A1F000472407 /* StoreReviewHelper.swift in Sources */, 73A6213B2330742C000FFB5B /* DomesticRemitInteractorIO.swift in Sources */, D950BED121549242008367A1 /* HomeModuleInterface.swift in Sources */, 04E36E1D21AE585200783685 /* PennyTestSubmitInteractor.swift in Sources */, @@ -15202,7 +15206,7 @@ CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 5QB497ZAGT; ENABLE_BITCODE = NO; @@ -15237,7 +15241,7 @@ CODE_SIGN_ENTITLEMENTS = "GME Remit.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 4; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 5QB497ZAGT; ENABLE_BITCODE = NO; diff --git a/GME Remit/AppDelegate.swift b/GME Remit/AppDelegate.swift index 3f74ebce..f0b81a66 100644 --- a/GME Remit/AppDelegate.swift +++ b/GME Remit/AppDelegate.swift @@ -62,6 +62,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { .app .remove([.isOpenedTokenRenwalAlert, .isOpenedPopupNotification]) + StoreReviewHelper.shared.incrementAppOpenedCount() return true } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift index 44b49fbe..2095f989 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyReceipt/User Interface/View/SendMoneyReceiptViewController.swift @@ -165,6 +165,14 @@ class SendMoneyReceiptViewController: UIViewController { self.navigationItem.title = "" } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if !isFromTransactionHistory { + StoreReviewHelper.shared.checkAndAskForReview() + } + } + // MARK: IBActions @IBAction func done(_ sender: UIButton) { if (isFromTransactionHistory) { diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift index 194910c7..eeb66a32 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift @@ -80,8 +80,8 @@ class SendMoneyVerificationViewController: UITableViewController { let reciepient = self.reciepient, let password = self.password, password != "" - else { - return + else { + return } model.transactionPassword = password @@ -296,7 +296,11 @@ extension SendMoneyVerificationViewController: BiometricAuthenticationViewContro } } - func viewController(_ viewController: BiometricAuthenticationViewController, didFailWithError error: BiometricAuthenticationError, errorMessage: String?) { + func viewController( + _ viewController: BiometricAuthenticationViewController, + didFailWithError error: BiometricAuthenticationError, + errorMessage: String? + ) { print("BiometricAuthenticationWireframe Error: \(errorMessage ?? "")") viewController.dismiss(animated: true){ @@ -309,7 +313,11 @@ extension SendMoneyVerificationViewController: BiometricAuthenticationViewContro switch type { case "autodebit": - SendMoneyCodeWireframe().open(requestmodel: self.requestModel, completion: self.otpEntered, source: self) + SendMoneyCodeWireframe().open( + requestmodel: self.requestModel, + completion: self.otpEntered, + source: self + ) case "wallet": self.showSecureKeypad() default: @@ -323,15 +331,15 @@ extension SendMoneyVerificationViewController: BiometricAuthenticationViewContro } } - func doSelectLocalAuthenticationPolicy(_ viewController: BiometricAuthenticationViewController) -> BiometricAuthenticationPolicy{ + func doSelectLocalAuthenticationPolicy( + _ viewController: BiometricAuthenticationViewController + ) -> BiometricAuthenticationPolicy{ return .deviceOwnerAuthenticationWithBiometrics } } extension SendMoneyVerificationViewController: SecureKeypadDelegate { func didComplete(_ encryptedString: String, garbagePassword: String, length: Int) { - func didComplete(_ encryptedString: String, length: Int) { - self.password = encryptedString - } + self.password = encryptedString } } diff --git a/GME Remit/Utilities/Database/GMEDB.swift b/GME Remit/Utilities/Database/GMEDB.swift index f8fd8421..f6c5b741 100644 --- a/GME Remit/Utilities/Database/GMEDB.swift +++ b/GME Remit/Utilities/Database/GMEDB.swift @@ -76,6 +76,7 @@ class GMEDB { case isOpenedTokenRenwalAlert case isOpenedPopupNotification + case openCount } let user = UserDefaultsWrapper() diff --git a/GME Remit/Utilities/StoreReviewHelper.swift b/GME Remit/Utilities/StoreReviewHelper.swift new file mode 100644 index 00000000..fc23e4a7 --- /dev/null +++ b/GME Remit/Utilities/StoreReviewHelper.swift @@ -0,0 +1,36 @@ +// +// StoreReviewHelper.swift +// GME Remit +// +// Created by InKwon James Kim on 02/10/2019. +// Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation +import StoreKit + +class StoreReviewHelper { + static let shared = StoreReviewHelper() + + func incrementAppOpenedCount() { + var appOpenCount = GMEDB.shared.app.integer(.openCount) + + appOpenCount += 1 + GMEDB.shared.app.set(appOpenCount, .openCount) + } + + func checkAndAskForReview() { + requestReview() +// let openCount = GMEDB.shared.app.integer(.openCount) +// +// switch openCount { +// case 3, 5: StoreReviewHelper().requestReview() +// case _ where openCount % 100 == 0 : StoreReviewHelper().requestReview() +// default: print("App run count is : \(openCount)") +// } + } + + private func requestReview() { + SKStoreReviewController.requestReview() + } +} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 75134edd..8ea7f9e6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,6 +18,10 @@ default_platform(:ios) platform :ios do desc "Push a new beta build to TestFlight" lane :beta do + # increment_build_number( + # build_number: app_store_build_number + 1, + # xcodeproj: "Example.xcodeproj" + # ) build_app(workspace: "GME Remit.xcworkspace", scheme: "GME Remit") upload_to_testflight end