     }
     
     func applicationWillTerminate(application: UIApplication) {
-
+        
         XLappMgr.get().applicationWillTerminate()
         
         UserAuthHelper.clearUser() //clear nsuserdefaults so the user is forced to login everytime they open the app

        let gai = GAI.sharedInstance()
        gai.trackUncaughtExceptions = true  // report uncaught exceptions
        gai.logger.logLevel = GAILogLevel.Verbose  // remove before app release

        
        return true
    }
    
    
    /**
    This method sets up MQA. If isDevelopment is set to true in info.plist, MQA isn't set up, else it is.
    */
    private func setUpMQA(){
        if(Utils.isDevelopment() != true){
        let configurationPath = NSBundle.mainBundle().pathForResource("Config", ofType: "plist")
        var mqaApplicationKey : String = ""
        
        var hasValidConfiguation = true
        
        if((configurationPath) != nil) {
            let configuration = NSDictionary(contentsOfFile: configurationPath!)!
            
            mqaApplicationKey = configuration["mqaApplicationKey"] as! String
            if(mqaApplicationKey == ""){
                hasValidConfiguation = false
                _ = "Open the Config.plist file and set the mqaId to the MQA application key"
            }
        }
        if(hasValidConfiguation){
            
            MQALogger.startNewSessionWithApplicationKey(mqaApplicationKey)
            
            NSSetUncaughtExceptionHandler(exceptionHandlerPointer)
        }else{
            NSException().raise()
        }
        }
    }
    

    
    
    /**
     If demo mode is one, an xtify notification will be sent to the user when the user puts the app in the background
     
     - parameter application:
     */
    func applicationDidEnterBackground(application: UIApplication) {
        XLappMgr.get().appEnterBackground()
        
        if (self.demoModeWillSendNotification == true){  //if demo mode is on, show notification upon entering background
            XtifyHelper.resetLocationForDemo()
            
            XtifyHelper.updateNearSummitStore()
        }
        
    }
    
    
    func applicationWillEnterForeground(application: UIApplication) {
        
        XLappMgr.get().appEnterForeground()
        
    }
    
    func applicationDidBecomeActive(application: UIApplication) {
        
        if (self.demoModeWillSendNotification == true){  //if demo mode is on, show notification upon entering background
            XtifyHelper.resetLocationForDemo()
            
            XtifyHelper.updateNearSummitStore()
        }
        XLappMgr.get().appEnterActive()
