react-native-contact-tracing

React-native module for Apple & Google's Contact Tracing Framework

Usage no npm install needed!

<script type="module">
  import reactNativeContactTracing from 'https://cdn.skypack.dev/react-native-contact-tracing';
</script>

README

react-native-contact-tracing

:warning: I do not own the react-native-contact-tracing package on npm. My package will remain unpublished until the official frameworks are released. The current owner of react-native-contact-tracing has a boilerplate project published to it and is in no way related to this repository. Until I can contact the owner of the package or find a better name: do not install this package from the directions below, they are placeholders only.

A native module for Apple & Google's Contact Tracing Framework.

This work is based on mattt's theoretical ContactTracingManager, Apple's ContactTracing API Documentation & Google's Android API Docs.

Help welcome for Android! see issue #1

Getting started

$ npm install react-native-contact-tracing --save

Mostly automatic installation

$ react-native link react-native-contact-tracing

Usage

Example

import ContactTracing from 'react-native-contact-tracing';

contactTracing.start();

Methods

Summary


Details

start()

await contactTracing.start();

Begin contact tracing, asking for permissions if need be. This returns a promise that resolves if tracing began successfully.


stop()

await contactTracing.stop();

Stops contact tracing, this also returns a promise that resolves if tracing ended successfully.


requestExposureSummary()

const { matchedKeyCount, contactInformation } = await contactTracing.requestExposureSummary();

Provides a summary on exposures. This returns a promise that resolves to an object containing the matchedKeyCount & an array of CTContactInfo objects.


currentStatus()

const status = await contactTracing.currentStatus();

This returns a promise that resolves to the current tracing status. The value is an integer.


License

This project has no affiliation with Apple or Google.

Information subject to copyright. All rights reserved.