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-chartbeat
and add RNReactNativeChartbeat.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReactNativeChartbeat.a
to your project's Build Phases
➜ Link Binary With Libraries
- In XCode, in the project navigator, select your project. Look for
Framework Search Paths
in Build Settings
, then add ($PROJECT_DIR)
and $(inherited)
. - Drag
Chartbeat.framework
from node_modules/react-native-chartbeat/ios/Frameworks
to your Frameworks
folder in XCode. - Add the following code to
AppDelegate.m
:
#import <Chartbeat/CBTracker.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[CBTracker sharedTracker] setDebugMode:true];
[[CBTracker sharedTracker] setLogLevel:CBTrackerLogLevelVerbose];
[[CBTracker sharedTracker] setupTrackerWithAccountId:1111 domain:@"domain.com" ];
...
}
- Run your project (
Cmd+R
)<
Usage
import Chartbeat from 'react-native-react-native-chartbeat';
Chartbeat.trackView('testViewId', 'testTitle');