I have a React Native app, that is using ExpoKit. I can eject if needed.
I want to access the NSUserDefaults object to read a value that has been pushed by AirWatch - a Mobile Device Management system. Basically the app is run in a Managed Environment, and the settings are passed through NSUserDefaults.
I haven't been able to use React Native's Settings (https://facebook.github.io/react-native/docs/settings), as it gives me an error about the internal _settings object being undefined when trying to access this._settings[t].
How to use this Settings module, or what should I do to access this settings object?
Check your pods, you are most probably missing the subspec "RCTSettings" for pod 'React', it was not added during the eject .. which is really strange.
This is how it looks for me:
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"RCTSettings",
"DevSupport",
"CxxBridge"
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With