iOS / Android Firebase:每个用户的跟踪事件

时间:2018-10-15 08:46:49

标签: android ios firebase firebase-analytics

我编写这样的代码将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];
}

0 个答案:

没有答案