A System Variable is a variable with a pre-defined value. Draftbit exposes different types of System Variables. Each variable has an existing value of a boolean type (
false) and cannot be overwritten.
There are four types of System Variables:
|Is Online||Returns a |
Uses React Native Netinfo API.
|Is iOS||Returns a |
|Is Android||Returns a |
|Is Web||Is Web - Returns a |
Note: All three variables, Is Android, Is iOS, and Is Web, use React Native's Platform module.
You may want to use a System variable when:
- Each platform (iOS, Android, and Web) has its own limitations. You can use a System Variable like Is Android, Is iOS, or Is Web when you want to handle platform-specific restrictions.
- You want to tweak the UI based on a specific platform. You will have to use Is Android, Is iOS, and Is Web based on the platform you want to customize the UI.
- The Is Online variable is used to determine if the device is online or not. It is helpful to use it with a Custom Component to display an in-app notification when the device is online or offline. Here is an example of how to use the Is Online variable used in a Custom Component:
Updated over 1 year ago