     func applicationDidBecomeActive(application: UIApplication) {
         // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
 
-        if !isColdLaunch {
-            isColdLaunch = false
-
+        if !isFirstActive {
             if YepUserDefaults.isLogined {
                 syncUnreadMessages() {
                 }

    var deviceToken: NSData?
    var notRegisteredPush = true

    var isColdLaunch = true

    struct Notification {
        static let applicationDidBecomeActive = "applicationDidBecomeActive"

        }

        NSNotificationCenter.defaultCenter().postNotificationName(Notification.applicationDidBecomeActive, object: nil)

        isFirstActive = false
    }

    func applicationWillTerminate(application: UIApplication) {
