React Native SDK configuration
Configuration for Android
Configure your workspace key in AndroidManifest.xml file.
Configuration for iOS
Add workspace key to your Info.plist file.
- Create
SurvicateDictionary. - Define
WorkspaceKeyString inSurvicateDictionary. YourInfo.plistfile should look like this:
Configuring Survicate Bindings for Expo
Add config plugin to plugins array of your app.json or app.config.js
_Note: Please note that every time you change the props or plugins, you'll need to rebuild the native app.
As an alternative to the main way of specifying the Workspace Key, you can also use the setWorkspaceKey() method.
Important:
- Regardless of the method used to set the Workspace Key, the config plugin entry with the
workspaceKeyproperty must be added to thepluginsarray in yourapp.jsonorapp.config.js. If you usesetWorkspaceKey()to provide the key at runtime, you still need to include the plugin entry with an emptyworkspaceKeyvalue. - Using
setWorkspaceKey()method overrides the Workspace Key defined in the configuration. setWorkspaceKey()method must be used beforeinitializeSdk()method is called.
Initialization
Initialize the SDK in your application using initializeSdk() method. Call this method only once, in the main component (e.g src/App.js file).