0.0.26 • Published 1 year ago

@quibr/react-native-screen-time-api v0.0.26

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Native Screen Time API

Access the Screen Time API for iOS and Wellbeing API for Android (coming soon).

Table of Contents

Installation

npm install react-native-screen-time-api

or

yarn add react-native-screen-time-api

Then run npx pod-install.

Usage

import { ScreenTime } from 'react-native-screen-time-api';

React.useEffect(() => {
  ScreenTime.requestAuthorization('individual').then(async () => {
    const status = await ScreenTime.getAuthorizationStatus();
    console.log('Authorization status:', status); // 'approved', 'denied', or 'notDetermined'
    await selection = await ScreenTime.displayFamilyActivityPicker();
    console.log('Family activity selection:', selection);
    // selection will be `null` if user presses cancel
    if (selection) {
      await ScreenTime.setActivitySelection(selection); // sets the shields
    }
  });
}, []);

Release a new version

npm login

npm publish
0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago