forked from adjust/ios_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathADJActivityKind.m
72 lines (66 loc) · 2.54 KB
/
ADJActivityKind.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// ADJActivityKind.m
// Adjust
//
// Created by Christian Wellenbrock on 11.02.14.
// Copyright (c) 2014 adjust GmbH. All rights reserved.
//
#import "ADJActivityKind.h"
@implementation ADJActivityKindUtil
#pragma mark - Public methods
+ (ADJActivityKind)activityKindFromString:(NSString *)activityKindString {
if ([@"session" isEqualToString:activityKindString]) {
return ADJActivityKindSession;
} else if ([@"event" isEqualToString:activityKindString]) {
return ADJActivityKindEvent;
} else if ([@"click" isEqualToString:activityKindString]) {
return ADJActivityKindClick;
} else if ([@"attribution" isEqualToString:activityKindString]) {
return ADJActivityKindAttribution;
} else if ([@"info" isEqualToString:activityKindString]) {
return ADJActivityKindInfo;
} else if ([@"gdpr" isEqualToString:activityKindString]) {
return ADJActivityKindGdpr;
} else if ([@"ad_revenue" isEqualToString:activityKindString]) {
return ADJActivityKindAdRevenue;
} else if ([@"disable_third_party_sharing" isEqualToString:activityKindString]) {
return ADJActivityKindDisableThirdPartySharing;
} else if ([@"subscription" isEqualToString:activityKindString]) {
return ADJActivityKindSubscription;
} else if ([@"third_party_sharing" isEqualToString:activityKindString]) {
return ADJActivityKindThirdPartySharing;
} else if ([@"measurement_consent" isEqualToString:activityKindString]) {
return ADJActivityKindMeasurementConsent;
} else {
return ADJActivityKindUnknown;
}
}
+ (NSString *)activityKindToString:(ADJActivityKind)activityKind {
switch (activityKind) {
case ADJActivityKindSession:
return @"session";
case ADJActivityKindEvent:
return @"event";
case ADJActivityKindClick:
return @"click";
case ADJActivityKindAttribution:
return @"attribution";
case ADJActivityKindInfo:
return @"info";
case ADJActivityKindGdpr:
return @"gdpr";
case ADJActivityKindAdRevenue:
return @"ad_revenue";
case ADJActivityKindDisableThirdPartySharing:
return @"disable_third_party_sharing";
case ADJActivityKindSubscription:
return @"subscription";
case ADJActivityKindThirdPartySharing:
return @"third_party_sharing";
case ADJActivityKindMeasurementConsent:
return @"measurement_consent";
default:
return @"unknown";
}
}
@end