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")
To save a value to UserDefaults you need to create a value key
Unless you've already created some extension which is adding an additional property to UserDefaults.. "apiToken" that you've not shared here, you'll need to create it like this
You will then be able to retrieve this from