I'm trying to access my iOS UserDefaults in my React Native app. I tried this with Settings from react-native.
I set the user defaults like this (native in Swift)
userDefaults?.set("test", forKey: "test")
and also tried it like this
UserDefaults.standard.set("test", forKey: "test")
And I'm trying to log it like this in my react-native app
import {Settings} from 'react-native';
const test = Settings.get('test');
console.log(test);
This logs undefined
I can't find a proper example anywhere, so I hope someone can help me out here.
I need to use the watchKeys() method for the purpose of my app, so react-native-user-defaults is not a solution in my case.
Thanks in advance!