Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

React Native module to access Android's native system time

License

Notifications You must be signed in to change notification settings

valora-inc/react-native-system-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-system-clock

A simple React Native module to access Android's native system time.

Getting started

$ npm install react-native-system-clock --save

Mostly automatic installation

$ react-native link react-native-system-clock

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNSystemClockPackage; to the imports at the top of the file
  • Add new RNSystemClockPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-system-clock'
    project(':react-native-system-clock').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-system-clock/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-system-clock')
    

Usage

import RNSystemClock from '@celo/react-native-system-clock'

await RNSystemClock.getDeviceTime()

About

React Native module to access Android's native system time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages