我编写这样的代码将Firebase事件设置为唯一用户。
+ (void)setUserInfo:(NSString *)userID andRegion:(NSString *)region {
@try {
if (userID != nil && userID.length > 0)
[FIRAnalytics setUserID:userID];
[FIRAnalytics setUserPropertyString:region forName:@"region"];
} @catch (NSException *exception) {
} @finally {
}
}
我也记录这样的事件(例如“ CLICK_NEWFEED”)。我怎么知道“用户A”触发“ CLICK_NEWFEED”? (及其触发的次数等)
+ (void)addEvent:(NSString *)eventTitle andParams:(NSDictionary *)params {
[FIRAnalytics logEventWithName:eventTitle
parameters:params];
BITMetricsManager *metricsManager = [BITHockeyManager sharedHockeyManager].metricsManager;
[metricsManager trackEventWithName:eventTitle properties:params measurements:nil];
}