Saving user data to internal memory - Apple TV Swift.

I am trying to save access token with in the application registry and getting saved success fully, but after rebooting the device and coming back to the device registry is getting cleared and user is taken back to the authentication page.

UserDefaults.standard.set(accessToken, forKey: "apiToken") UserDefaults.standard.synchronize()

let apiToken = UserDefaults.standard.value(forKey: "apiToken")