Remote configuration for React Native apps
Remote Config enables you to change the behavior or appearance of the app by making changes to the server side values. To add the parameters and conditions in the Remote Config UI, refer to the User Guide.
Add the SDK to your app
- Before your begin, make sure that Apptics is integrated into your project by following the Integration Guide.
- Use the below method to fetch value for a param.
Copiedimport { Apptics, AppticsRemoteConfig} from '@zoho_apptics/apptics-react-native';
AppticsRemoteConfig.getStringValue("param_name", false, true).then(function(success: string) {
console.log(success);
})
getStringValue accept three params.
- key [string] - the name of the param configured in the web console.
- 'coldFetch' getStringValue has a cache mechanism which will prevent frequent network calls. If coldFetch is enabled, getStringValue fetches from network ignoring the cache mechanisms. Only three calls to the network are allowed per minute. If this threshold breaks, the method will return Null or fallback to offline value.
- 'fallbackWithOfflineValue' - If enabled, getStringValue will return the previously fetched value incase of Network failures.
Set custom criteria
- Use the below method to set the custom condition criteria for the device.
Copiedimport { Apptics, AppticsRemoteConfig} from '@zoho_apptics/apptics-react-native';
AppticsRemoteConfig.setCustomCondition("condtionKey", "conditionValue")