Swift fetch from React Native asyncstorage

Viewed 277

I'm trying to fetch values that are stored in React Natives AsyncStorage with Swift. There isn't a lot of documentation around and most of the information about how to do this is outdated. How can I go about fetching data from AsyncStorage in swift?

let storage = RCTBridge.module(forClass: RNCAsyncStorage.self)
storage.multiGet(["count"])

I'm getting this error from the above line of code. Cannot find 'RNCAsyncStorage' in scope

1 Answers

You have to be sure that you are importing the following header in Bridging-Header file #import <RNCAsyncStorage/RNCAsyncStorage.h>

Related