An open API service indexing awesome lists of open source software.

https://github.com/shukerullah/react-native-chartbeat-sdk


https://github.com/shukerullah/react-native-chartbeat-sdk

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# React Native Chartbeat SDK

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

## Installation

```sh
yarn add react-native-chartbeat-sdk
```

or if you're using __npm__

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

## Usage

```js
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) {
Chartbeat.setSections(sections);
}

function setAuthors(authors: Array) {
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](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

### Follow me on Twitter: [@shukerullah](https://twitter.com/shukerullah)

Buy Me A Coffee