Skip to content

Instantly share code, notes, and snippets.

@luisobo
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisobo/ef9568876d83371ac0a2 to your computer and use it in GitHub Desktop.
Save luisobo/ef9568876d83371ac0a2 to your computer and use it in GitHub Desktop.
Disable advertisingIdentifier to avoid AppStore rejection
__attribute__((constructor))
void PIXWhatPartOfAdvertisingTrackingEnabledDidYouNotUnderstand(void) {
if (![[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
IMP newImplementation = imp_implementationWithBlock(^NSUUID *{
return nil;
});
Method m = class_getInstanceMethod([ASIdentifierManager class], @selector(advertisingIdentifier));
method_setImplementation(m, newImplementation);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment