Win the heart of every user
Branch: master
Clone or download
Pull request Compare This branch is 43 commits ahead, 27 commits behind segmentio:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.buildscript
.github
BytegainAnalytics.xcodeproj
BytegainAnalytics.xcworkspace
BytegainAnalytics
BytegainAnalyticsTests
Examples
rename
.clang-format
.gitignore
BytegainAnalytics.podspec
CHANGELOG.md
CONTRIBUTING.md
LICENSE
Makefile
Podfile
Podfile.lock
README.md
RELEASING.md
circle.yml
codecov.yml

README.md

BytegainAnalytics

Version License codecov

bg-analytics-ios is an iOS client for ByteGain.

Installation

BytegainAnalytics is available through CocoaPods

CocoaPods

Add the dependence:

pod "BytegainAnalytics", "4.0.2"

to your Podfile.

Documentation

The functioning example is in Examples/CocoapodsExample.

Initialization is done in the Examples/CocoapodsExample/CocoapodsExample/AppDelegate.m:

NSString *const BYTEGAIN_API_KEY = @"YOUR API_KEY GOES HERE";

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [ByteGainAnalytics debug:YES];
    ByteGainAnalyticsConfiguration *configuration = [ByteGainAnalyticsConfiguration configurationWithWriteKey:BYTEGAIN_API_KEY];
    configuration.trackApplicationLifecycleEvents = YES;
    configuration.trackAttributionData = YES;
    configuration.recordScreenViews = YES;
    configuration.flushAt = 10;
    [ByteGainAnalytics setupWithConfiguration:configuration];

The above sets up automatic reporting of screen views and application life cycle events to ByteGain servers.

To send additional event data to ByteGain servers, e.g., button clicks, add calls to the track method:

- (IBAction)fireEvent:(id)sender
{
    [[ByteGainAnalytics sharedAnalytics] track:@"Cocoapods Example Button"];

For more examples, see Examples/CocoapodsExample/CocoapodsExample/ViewController.m.

The code has been tested for Objective-C apps using XCode version 10.1.