Skip to content

Use token storage for tokens#171

Merged
ahmedre merged 1 commit into
mainfrom
better_storage
May 13, 2026
Merged

Use token storage for tokens#171
ahmedre merged 1 commit into
mainfrom
better_storage

Conversation

@ahmedre
Copy link
Copy Markdown
Contributor

@ahmedre ahmedre commented May 12, 2026

This patch updates the library to use token storage for storage,
resulting in secure storage on both Android and iOS, instead of
SharedPreferences and NSUserDefaults. In iOS, it's stored in the
KeyChain, in Android, it's stored in DataStore but encrypted.

This also updates the normal storage to be stored in DataStore. On iOS,
this is a preference file in Application Support.

This patch updates the library to use token storage for storage,
resulting in secure storage on both Android and iOS, instead of
SharedPreferences and NSUserDefaults. In iOS, it's stored in the
KeyChain, in Android, it's stored in DataStore but encrypted.

This also updates the normal storage to be stored in DataStore. On iOS,
this is a preference file in Application Support.
@ahmedre
Copy link
Copy Markdown
Contributor Author

ahmedre commented May 12, 2026

after these changes, initialization should look something like:

  // Android
  val graph = SharedDependencyGraph.init(
      driverFactory = DriverFactory(context = applicationContext),
      storage = createMobileSyncStorage(applicationContext),
      appEnvironment = AppEnvironment.PRELIVE,
      clientId = appClientId,
      clientSecret = appClientSecret
  )
  // iOS
  let storage = AppleMobileSyncStorageFactory.shared.create()

  graph = SharedDependencyGraph.shared.doInit(
      driverFactory: DriverFactory(),
      storage: storage,
      appEnvironment: AppEnvironment.prelive,
      clientId: appClientId,
      clientSecret: appClientSecret
  )

@ahmedre ahmedre merged commit ff3e88c into main May 13, 2026
1 check passed
@ahmedre ahmedre deleted the better_storage branch May 13, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants