react-native-chartbeat-sdk

0.0.1 • Public • Published

React Native Chartbeat SDK

The React Native Chartbeat SDK is a native library providing Chartbeat tracking functionality for Android and iOS apps.

Installation

yarn add react-native-chartbeat-sdk

or if you're using npm

npm install react-native-chartbeat-sdk --save

Usage

import Chartbeat from "react-native-chartbeat-sdk";

function setupTracker(accountId: string, domain: string) {
  Chartbeat.setupTracker(accountId, domain);
}

function trackView(viewId: string, viewTitle: string) {
  Chartbeat.trackView(viewId, viewTitle);
}

function setSections(sections: Array<string>) {
  Chartbeat.setSections(sections);
}

function setAuthors(authors: Array<string>) {
  Chartbeat.setAuthors(authors);
}

function setUserAnonymous() {
  Chartbeat.setUserAnonymous();
}

function setUserLoggedIn() {
  Chartbeat.setUserLoggedIn(authors);
}

function setUserPaid() {
  Chartbeat.setUserPaid();
}

function stopTracker() {
  Chartbeat.stopTracker();
}

// Call the userInteracted function whenever the user interacts with your view to accurately measure user engagement with your content.
// NOTE: This is not needed for the iOS SDK, as those interactions are tracked automatically.
function userInteracted() {
  if(Platform.OS === 'android') {
    Chartbeat.userInteracted();
  }
}

Contributing

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

License

MIT

Follow me on Twitter: @shukerullah

Buy Me A Coffee

/react-native-chartbeat-sdk/

    Package Sidebar

    Install

    npm i react-native-chartbeat-sdk

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    34.9 kB

    Total Files

    17

    Last publish

    Collaborators

    • shukerullah