App State

Will bootstrap the VisualProvider of the digital-reactnative-visual and give you information about your device.

Code sample

import { DokaApp, AppState } from '@dormakaba/digital-reactnative-client';

<DokaApp>
  <AppState>
    {({ offline, deviceInfo }) => (
      <View>
        <Text>{`is offline: ${offline}`}</Text>
        <Text>{JSON.stringify(deviceInfo)}</Text>
      </View>
    )}
  </AppState>
</DokaApp>

Use the DokaApp component once as a wrapper for you app.

deviceInfo will contain following information:

deviceInfo: {
  isTablet,
  width,
  height,
  isPortrait,
  isLandscape
}

Last updated