Skip to content

Commit

Permalink
Merge pull request #111 from mixpanel/ifa-changes
Browse files Browse the repository at this point in the history
Use IFA only if AdSupport framework is compiled in the app
  • Loading branch information
alex-hofsteede committed Feb 4, 2014
2 parents cff3702 + 281e4e6 commit 100d40b
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Mixpanel/Mixpanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#import "NSData+MPBase64.h"
#import "UIView+MPSnapshotImage.h"

#define VERSION @"2.3.0"
#define VERSION @"2.3.1"

#ifdef MIXPANEL_LOG
#define MixpanelLog(...) NSLog(__VA_ARGS__)
Expand Down Expand Up @@ -238,9 +238,9 @@ - (NSString *)deviceModel
return results;
}

- (NSString *)ifa
- (NSString *)IFA
{
NSString* ifa = nil;
NSString *ifa = nil;
#ifndef MIXPANEL_NO_IFA
Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager");
if (ASIdentifierManagerClass) {
Expand Down Expand Up @@ -296,9 +296,7 @@ - (NSMutableDictionary *)collectAutomaticProperties
if (carrier.carrierName.length) {
[p setValue:carrier.carrierName forKey:@"$carrier"];
}
if ([self ifa]) {
[p setValue:[self ifa] forKey:@"$ios_ifa"];
}
[p setValue:[self IFA] forKey:@"$ios_ifa"];
return p;
}

Expand Down Expand Up @@ -407,7 +405,7 @@ + (void)assertPropertyTypes:(NSDictionary *)properties

- (NSString *)defaultDistinctId
{
NSString *distinctId = [self ifa];
NSString *distinctId = [self IFA];

if (!distinctId && NSClassFromString(@"UIDevice")) {
distinctId = [[UIDevice currentDevice].identifierForVendor UUIDString];
Expand Down Expand Up @@ -1375,9 +1373,7 @@ - (NSDictionary *)collectAutomaticProperties
__strong Mixpanel *strongMixpanel = _mixpanel;
if (strongMixpanel) {
[p setValue:[strongMixpanel deviceModel] forKey:@"$ios_device_model"];
if ([strongMixpanel ifa]) {
[p setValue:[strongMixpanel ifa] forKey:@"$ios_ifa"];
}
[p setValue:[strongMixpanel IFA] forKey:@"$ios_ifa"];
}
[p setValue:[device systemVersion] forKey:@"$ios_version"];
[p setValue:VERSION forKey:@"$ios_lib_version"];
Expand Down

0 comments on commit 100d40b

Please sign in to comment.