react-native-chartbeat-sdk
v0.0.1
Published
The React Native Chartbeat SDK is a native library providing Chartbeat tracking functionality for Android and iOS apps.
Downloads
3
Maintainers
Readme
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