Saving and loading private iOS app data

My iOS app goes through a login process to eventually be given an authentication token that can be used for a period of time (e.g. 24 hours) before it expires and a new one is needed.

What I’d like to do is save that token somewhere on the device that only my app has access to so that the user can quit, reload, and get access to it using FaceID/thumbprint and only have to re-authenticate if the token has expired.

I’m not finding any sandboxed storage location (or functionality) that only my app has access to. I suppose I could write directly to the drive and encrypt the data, but I’d prefer not to if there’s something already built-in for this use case.

Typically you would store this type of info in the keychain.

Sure, but sadly the Keychain isn’t supported on iOS (at least not in the Xojo core) even though it is definitely there. :frowning:

Either in the keychain or NSUserDefaults.

I believe both are available in iOSkit

1 Like