Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brighthustle/react-native-usage-stats-manager

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brighthustle/react-native-usage-stats-manager

Usage Stats Manager Plugin

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@brighthustle/react-native-usage-stats-manager

Usage Stats Manager Plugin

Installation

npm install @brighthustle/react-native-usage-stats-manager

Android

Permission need to be added on AndroidManifest.xml


<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />

If Build Error on kotlin add kotlinVersion to the gradle.properties


kotlinVersion=1.8.10

Usage

import {
  EventFrequency,
  checkForPermission,
  queryUsageStats,
  showUsageAccessSettings,
} from '@brighthustle/react-native-usage-stats-manager';

Time needs to be in millisecond for function queryUsageStats

const startDateString = '2023-06-11T12:34:56';
const endDateString = '2023-07-11T12:34:56';

const startMilliseconds = new Date(startDateString).getTime();
const endMilliseconds = new Date(endDateString).getTime();

const result = await queryUsageStats(
      EventFrequency.INTERVAL_DAILY,
      startMilliseconds,
      endMilliseconds
    )

Check Permission & Open Permission Activity

checkForPermission().then((res: any) => {
  if (!res) {
    showUsageAccessSettings('');
  }
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Keywords

FAQs

Package last updated on 29 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc