     
     public static let iRateCouldNotConnectToAppStore = "iRateCouldNotConnectToAppStore"
     private static let iRateDidDetectAppUpdate = "iRateDidDetectAppUpdate"
-    private static let iRateDidPromptForRating = "iRateDidPromptForRating"
+    public static let iRateDidPromptForRating = "iRateDidPromptForRating"
     private static let iRateUserDidAttemptToRateApp = "iRateUserDidAttemptToRateApp"
     private static let iRateUserDidDeclineToRateApp = "iRateUserDidDeclineToRateApp"
     private static let iRateUserDidRequestReminderToRateApp = "iRateUserDidRequestReminderToRateApp"

            let lastUsedVersion = defaults.objectForKey(iRateLastVersionUsedKey) as? String ?? ""
            if self.firstUsed == nil || lastUsedVersion != self.applicationVersion {
                defaults.setObject(self.applicationVersion, forKey: iRateLastVersionUsedKey)
                if self.firstUsed == nil {
                    
                }
            }
        }

            operationQueue.addOperation(operation)
        }
        
        /// 如果网络有效将检查AppStore的App信息
        func promptIfNetworkAvailable() {
            if (self.checkingForPrompt == false && self.checkingForAppStoreID == false) {
                self.checkingForPrompt = true
                checkForConnectivityInBackground()
            }
        }
        
        /// 检查shouldPromptForRating和promptIfNetworkAvailable方法是否满足
        func promptIfAllCriteriaMet() {
            if shouldPromptForRating() {
                promptIfNetworkAvailable()
            }
        }
        
        func showRemindButton() -> Bool {
            return self.remindButtonLabel.characters.count > 0
        }
        
        func showCancelButton() -> Bool {
            return self.cancelButtonLabel.characters.count > 0
        }
        
        /// 弹出提醒
        func promptForRating() {
            if self.visibleAlert != nil {
                let message = self.ratedAnyVersion ? self.updateMessage : self.message
                
                var topController = UIApplication.sharedApplication().keyWindow?.rootViewController
                while ((topController?.presentedViewController) != nil) {
                    topController = topController?.presentedViewController
                }
                
                let alert = UIAlertController(title: self.messageTitle, message: message, preferredStyle: .Alert)
                
                // rate action
                let rateAction = UIAlertAction(title: self.rateButtonLabel, style: .Default, handler: {(action) -> Void in
                    self.rate()
                })
                alert.addAction(rateAction)
                
                // remind action
                if showRemindButton() {
                    let remindAction = UIAlertAction(title: self.remindButtonLabel, style: .Default, handler: {(action) -> Void in
                        self.remindLater()
                    })
                    alert.addAction(remindAction)
                }
                
                // cancel action
                if showCancelButton() {
                    let cancelAction = UIAlertAction(title: self.cancelButtonLabel, style: .Cancel, handler: {(action) -> Void in
                        self.declineThisVersion()
                    })
                    alert.addAction(cancelAction)
                }
                
                self.visibleAlert = alert
                // get current view controller and present alert
                topController!.presentViewController(alert, animated: true, completion: nil)
                
                // inform about prompt
                self.delegate?.iRateDidPromptForRating!()
                NSNotificationCenter.defaultCenter().postNotificationName(iRateDidPromptForRating, object: nil)
            }
        }
        
