128 lines
2.7 KiB
Objective-C
128 lines
2.7 KiB
Objective-C
//
|
|
// XPFirebbaseEvent.m
|
|
// xplan-ios
|
|
//
|
|
// Created by duoban on 2022/11/10.
|
|
//
|
|
|
|
#import "XPFirebbaseEvent.h"
|
|
#import <Firebase/Firebase.h>
|
|
#import "XPEventHead.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@implementation XPFirebbaseEvent
|
|
|
|
|
|
+(void)registeringEventWithType:(XPPlatformType)type{
|
|
NSString *platform = @"";
|
|
switch (type) {
|
|
case PlatformOfFB:
|
|
{
|
|
platform = facebook;
|
|
break;
|
|
}
|
|
case PlatformOfLine:
|
|
{
|
|
platform = line;
|
|
break;
|
|
}
|
|
case PlatformOfID:
|
|
{
|
|
platform = userId;
|
|
break;
|
|
}
|
|
case PlatFormOfPhone:
|
|
{
|
|
platform = phone;
|
|
}
|
|
default:
|
|
{
|
|
platform = google;
|
|
break;
|
|
}
|
|
}
|
|
[FIRAnalytics logEventWithName:kFIREventSignUp
|
|
parameters:@{
|
|
kFIRParameterMethod: platform
|
|
}];
|
|
|
|
}
|
|
+(void)loginEventWithType:(XPPlatformType)type{
|
|
NSString *platform = @"";
|
|
switch (type) {
|
|
case PlatformOfFB:
|
|
{
|
|
platform = facebook;
|
|
break;
|
|
}
|
|
case PlatformOfLine:
|
|
{
|
|
platform = line;
|
|
break;
|
|
}
|
|
case PlatformOfID:
|
|
{
|
|
platform = userId;
|
|
break;
|
|
}
|
|
case PlatFormOfPhone:
|
|
{
|
|
platform = phone;
|
|
}
|
|
default:
|
|
{
|
|
platform = google;
|
|
break;
|
|
}
|
|
}
|
|
[FIRAnalytics logEventWithName:kFIREventLogin
|
|
parameters:@{
|
|
kFIRParameterMethod: platform
|
|
}];
|
|
}
|
|
+(void)shareEventWithContentID:(NSString *)contentID type:(XPPlatformType)type{
|
|
NSString *platform = @"";
|
|
switch (type) {
|
|
case PlatformOfFB:
|
|
{
|
|
platform = facebook;
|
|
break;
|
|
}
|
|
case PlatformOfLine:
|
|
{
|
|
platform = line;
|
|
break;
|
|
}
|
|
case PlatformOfID:
|
|
{
|
|
platform = userId;
|
|
break;
|
|
}
|
|
case PlatFormOfPhone:
|
|
{
|
|
platform = phone;
|
|
}
|
|
default:
|
|
{
|
|
platform = google;
|
|
break;
|
|
}
|
|
}
|
|
[FIRAnalytics logEventWithName:kFIREventShare
|
|
parameters:@{
|
|
kFIRParameterContent: contentID,
|
|
kFIRParameterContentType: platform
|
|
}];
|
|
}
|
|
+(void)event:(NSString *)eventId attributes:(NSDictionary *)attributes{
|
|
[FIRAnalytics logEventWithName:eventId
|
|
parameters:attributes];
|
|
}
|
|
|
|
@end
|