Best way to save access token (localstorage vs sqlite)


#1

Hi!

I’ve noticed that my app in ios is erasing the localstorage randomly and is where i’m saving the access token so the user is logout…

What is the best method? LocalStorage or SQLite? Is there any tutorial to storage this kind of data in sqlite?

Thanks!!


#2

Android -> SharedPreferences
iOS -> keychain


#3

and a universal method?

Thanks!


#4

=> localStorageService.set(‘authorizationToken’, data.authorizationToken);

See: http://robferguson.org/2015/07/27/authentication-for-ionic-apps/