SecureStore data not available in background-fetch

SDK Version: 46
Platforms(Android/iOS/web/all): all

My app uses a connection-code method like known from youtube on smarttv to authenticate for an existing account in my webapplication. My API responds with JWT access- and refreshtokens that are stored on the device using expo-secure-store

export const getItem = async (name: string) => SecureStore.getItemAsync(name);
export const setItem = async (name: string, value: string) =>
  SecureStore.setItemAsync(name, value, { keychainAccessible: SecureStore.ALWAYS_THIS_DEVICE_ONLY });

Every some hours, my app needs to perform a background-fetch task to sync data with the server.
This task is registered with these options: { minimumInterval: 7200, stopOnTerminate: false, startOnBoot: true }

By adding some senty messages I noticed, that sometimes the tokens in SecureStore are not availible when the task executes and thus the user cannot be authenticated.
I found an issue on github that unfortunatly was closed of inactivity but seems still unresolved. It reads quite simmilar to what I observed: [ios] Items set in `AsyncStorage` and `SecureStore` inaccessible in background tasks when in headless mode. · Issue #13228 · expo/expo · GitHub

Has anyone successfully worked with SecureStore data in background-fetch?
Is there a workaround, missing permission entry or configuration trick that could make the data accessible in background-fetch on android and ios?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.