https://github.com/shukerullah/react-native-chartbeat-sdk
https://github.com/shukerullah/react-native-chartbeat-sdk
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shukerullah/react-native-chartbeat-sdk
- Owner: shukerullah
- License: mit
- Created: 2022-12-12T15:13:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-07T10:42:15.000Z (5 months ago)
- Last Synced: 2025-01-07T11:39:06.168Z (5 months ago)
- Language: Java
- Size: 178 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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)