1.0.0 • Published 8 years ago
react-native-react-native-chartbeat v1.0.0
react-native-react-native-chartbeat
NOT FOR PRODUCTION USE.
Currently developing for iOS only (WIP).
Getting started
$ npm install react-native-chartbeat --save || yarn add react-native-chartbeat
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-react-native-chartbeatand addRNReactNativeChartbeat.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNReactNativeChartbeat.ato your project'sBuild Phases➜Link Binary With Libraries - In XCode, in the project navigator, select your project. Look for
Framework Search PathsinBuild Settings, then add($PROJECT_DIR)and$(inherited). - Drag
Chartbeat.frameworkfromnode_modules/react-native-chartbeat/ios/Frameworksto yourFrameworksfolder in XCode. - Add the following code to
AppDelegate.m:
#import <Chartbeat/CBTracker.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[CBTracker sharedTracker] setDebugMode:true]; // For debugging purposes
[[CBTracker sharedTracker] setLogLevel:CBTrackerLogLevelVerbose]; // For debugging purposes
[[CBTracker sharedTracker] setupTrackerWithAccountId:1111 domain:@"domain.com" ]; // Required
...
}- Run your project (
Cmd+R)<
Usage
import Chartbeat from 'react-native-react-native-chartbeat';
Chartbeat.trackView('testViewId', 'testTitle');