Skip to content

Commit 235ebec

Browse files
author
Brandon Sneed
committed
Simplified
1 parent ff47e1f commit 235ebec

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

Pod/Classes/SEGAmplitudeIntegration.m

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,36 +138,8 @@ - (void)realTrack:(NSString *)event properties:(NSDictionary *)properties integr
138138
// Track revenue. If revenue is not present fallback on total
139139
NSNumber *revenueOrTotal = [SEGAmplitudeIntegration extractRevenueOrTotal:properties withRevenueKey:@"revenue" andTotalKey:@"total"];
140140
if (revenueOrTotal) {
141-
[self trackRevenue:properties andRevenueOrTotal:revenueOrTotal];
142-
}
143-
}
144-
145-
- (void)trackRevenue:(NSDictionary *)properties andRevenueOrTotal:(NSNumber *)revenueOrTotal
146-
{
147-
// Use logRevenueV2 with revenue properties.
148-
if ([(NSNumber *)self.settings[@"useLogRevenueV2"] boolValue]) {
149141
[self trackLogRevenueV2:properties andRevenueOrTotal:revenueOrTotal];
150-
return;
151142
}
152-
153-
// fallback to logRevenue v1
154-
NSString *productId = properties[@"productId"] ?: properties[@"product_id"] ?: nil;
155-
NSNumber *quantity = properties[@"quantity"] ?: [NSNumber numberWithInt:1];
156-
id receipt = properties[@"receipt"] ?: nil;
157-
158-
AMPRevenue *revenue = [AMPRevenue revenue];
159-
[revenue setProductIdentifier:productId];
160-
revenue.price = revenueOrTotal;
161-
revenue.quantity = [quantity integerValue];
162-
revenue.receipt = receipt;
163-
[self.amplitude logRevenueV2:revenue];
164-
/* deprecated
165-
[self.amplitude logRevenue:productId
166-
quantity:[quantity integerValue]
167-
price:revenueOrTotal
168-
receipt:receipt];
169-
*/
170-
SEGLog(@"[Amplitude logRevenue:%@ quantity:%d price:%@ receipt:%@];", productId, [quantity integerValue], revenueOrTotal, receipt);
171143
}
172144

173145
- (void)trackLogRevenueV2:(NSDictionary *)properties andRevenueOrTotal:(NSNumber *)revenueOrTotal

0 commit comments

Comments
 (0)