             if #available(iOS 10.0, *) {
                 if let token = UserDefaults.standard.object(forKey: "deviceToken") as? String {
                     CardapioServices.shared.unregisterDeviceToken(token: token)
+                    
+                    UserDefaults(suiteName: "group.bandex.shared")?.set(nil, forKey: "notificacao_almoco")
+                    UserDefaults(suiteName: "group.bandex.shared")?.set(nil, forKey: "notificacao_jantar")
+                    self.loadNotificationOptions()
+                    
                 } else {
                     print("Device token nao encontrado para ser removido")
                 }

    
    
    
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        dietaSwitch.isOn = UserDefaults(suiteName: "group.bandex.shared")!.bool(forKey: "vegetariano")
        notificationSwitch.isOn = UserDefaults.standard.bool(forKey: notificationsUserDefaultsString)
        // back button color
        self.navigationController?.navigationBar.tintColor = UIColor(red:0.96, green:0.42, blue:0.38, alpha:1.0)
        

            // Executing is main queue because of warning from XCode 9 thread sanitizer.
            DispatchQueue.main.async {
                UIApplication.shared.registerForRemoteNotifications()
                
                // TODO: atualizar opcoes de notificacoes no User Defaults.
                UserDefaults(suiteName: "group.bandex.shared")?.set("11:00", forKey: "notificacao_almoco")
                UserDefaults(suiteName: "group.bandex.shared")?.set("17:00", forKey: "notificacao_jantar")

                // atualizar UI.
                self.loadNotificationOptions()
                
            }
        }
    }
