Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.