Skip to content

Instantly share code, notes, and snippets.

@tgoldenberg
Created February 9, 2016 04:16
Show Gist options
  • Select an option

  • Save tgoldenberg/ee8f542307ac7d40269b to your computer and use it in GitHub Desktop.

Select an option

Save tgoldenberg/ee8f542307ac7d40269b to your computer and use it in GitHub Desktop.
Analytics logic
//
// AnalyticsHelper.m
// assembly
//
// Created by Thomas Goldenberg on 2/8/16.
// Copyright © 2016 Facebook. All rights reserved.
//
#import "AnalyticsHelper.h"
#import <Analytics/SEGAnalytics.h>
@implementation AnalyticsHelper
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(identify: (NSString*)userId){
// [SEGAnalytics debug:YES];
[[SEGAnalytics sharedAnalytics] identify:userId];
}
RCT_EXPORT_METHOD(login: (NSString*)userId){
// [SEGAnalytics debug:YES];
[[SEGAnalytics sharedAnalytics] track:@"logins"
properties: @{ @"user": userId, @"type": @"login"}];
}
RCT_EXPORT_METHOD(shareContent: (NSString*)userId){
// [SEGAnalytics debug: YES];
[[SEGAnalytics sharedAnalytics] track: @"shares"
properties: @{ @"user": userId, @"type": @"share content"}];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment