0.2.2 • Published 2 years ago

react-native-esper-sdk v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-esper-sdk

React Native Module that interacts with the Esper SDK

Installation

npm install react-native-esper-sdk

Android Manual Installation

  1. In your android level build.gradle, add the following line to the repositories:
    • maven { url "https://artifact.esper.io/artifactory/esper-device-sdk/" }
  2. Afterwards, add the following dependencies to the build.gradle inside android/app folder:
    // Provide the Esper SDK
    implementation 'io.esper.devicesdk:app:2.1.6510.20'
    implementation 'androidx.annotation:annotation:1.1.0'
  3. Finnaly, for android 11, add the following code to AndroidManifest.xml:
    <queries>
            <package android:name="io.shoonya.shoonyadpc"/>
    </queries>

You can also check the Esper SDK documentation for a detailed explanation of the changes needed.

Usage

import { checkSDKActivation, getDeviceId, getSerialNumber, getDeviceUUID } from "react-native-esper-sdk";

// ...
const isActive = await checkSDKActivation(accessToken);
console.log("Esper SDK isActive:", isActive);
if (isActive) {
    const esperDeviceId = await getDeviceId();
    if (esperDeviceId != null) {
        console.log("Got esperDeviceId:", esperDeviceId);
    }

    const serialNumber = await getSerialNumber();
    if (serialNumber != null) {
        console.log("Got serialNumber:", serialNumber);
    }

    const uuid = await getDeviceUUID();
    if (uuid != null) {
        console.log("Got UUID:", uuid);
    }
}

Contributing

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

License

MIT