diff --git a/NearDrop/AppDelegate.swift b/NearDrop/AppDelegate.swift index 3a52ac1..0a8878f 100644 --- a/NearDrop/AppDelegate.swift +++ b/NearDrop/AppDelegate.swift @@ -201,9 +201,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: ["transfer_"+id]) self.activeIncomingTransfers.removeValue(forKey: id) - DispatchQueue.main.asyncAfter(deadline: .now() + 2) { - SKStoreReviewController.requestReview() + let currentCount = UserDefaults.standard.integer(forKey: "reviewRequestCountKey") + + if currentCount % 20 == 0 { + DispatchQueue.main.asyncAfter(deadline: .now() + 2) { + SKStoreReviewController.requestReview() + } } + + UserDefaults.standard.set(currentCount + 1, forKey: "reviewRequestCountKey") } }