Created
February 9, 2016 04:16
-
-
Save tgoldenberg/ee8f542307ac7d40269b to your computer and use it in GitHub Desktop.
Analytics logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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