Skip to content

Commit

Permalink
Fix iOS output
Browse files Browse the repository at this point in the history
  • Loading branch information
apparition47 committed Nov 9, 2016
1 parent fed9b06 commit 46a2219
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/ios/AndroidIDFA.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- (void)getIDFV:(CDVInvokedUrlCommand*)command;

- (void)getLimitAdFlag:(CDVInvokedUrlCommand*)command;
- (void)getLimitAd:(CDVInvokedUrlCommand*)command;

- (void)getAdInfo:(CDVInvokedUrlCommand*)command;

Expand Down
7 changes: 3 additions & 4 deletions src/ios/AndroidIDFA.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ - (void)getAdId:(CDVInvokedUrlCommand*)command

// have to handle iOS bug where 00000000-0000-0000-0000-000000000000 may be returned on iOS 6.0
if (advertiserID != nil && [advertiserID length] > 0 && ![advertiserID isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:advertiserID];
NSDictionary *data = @{@"idfa" : advertiserID};
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:data];
}

else {
Expand Down Expand Up @@ -61,16 +62,14 @@ - (void)getIDFV:(CDVInvokedUrlCommand*)command

// Returns advertisingTrackingEnabled as boolean
// Will return error on iOS < 6.0 since AdSupport framwork doesn't exist
- (void)getLimitAdFlag:(CDVInvokedUrlCommand*)command
- (void)getLimitAd:(CDVInvokedUrlCommand*)command
{
[self.commandDelegate runInBackground:^{
CDVPluginResult* pluginResult = nil;

if (NSClassFromString(@"ASIdentifierManager")) {

BOOL enabled = [[NSClassFromString(@"ASIdentifierManager") sharedManager] isAdvertisingTrackingEnabled];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:!enabled];

NSDictionary *data = @{@"limitAd" : [NSNumber numberWithBool:!enabled]};

pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:data];
Expand Down

0 comments on commit 46a2219

Please sign in to comment.