1.0.0 • Published 6 years ago

react-native-react-native-chartbeat v1.0.0

Weekly downloads
5
License
-
Repository
-
Last release
6 years ago

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

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-react-native-chartbeat and add RNReactNativeChartbeat.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNReactNativeChartbeat.a to your project's Build PhasesLink Binary With Libraries
  4. In XCode, in the project navigator, select your project. Look for Framework Search Paths in Build Settings, then add ($PROJECT_DIR) and $(inherited).
  5. Drag Chartbeat.framework from node_modules/react-native-chartbeat/ios/Frameworks to your Frameworks folder in XCode.
  6. 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
  ...
}
  1. Run your project (Cmd+R)<

Usage

import Chartbeat from 'react-native-react-native-chartbeat';
Chartbeat.trackView('testViewId', 'testTitle');