Skip to content

Instantly share code, notes, and snippets.

@Gerjo
Created November 20, 2019 13:31
Show Gist options
  • Save Gerjo/0e31214fbc5aca1ecc974be26d3678fa to your computer and use it in GitHub Desktop.
Save Gerjo/0e31214fbc5aca1ecc974be26d3678fa to your computer and use it in GitHub Desktop.
Remove dodgy MS AppCenter NSUserDefaults keys
NSUserDefaults* def = [NSUserDefaults standardUserDefaults];
for(NSString* key in @[@"pastDevicesKey", @"SessionIdHistory", @"UserIdHistory"])
{
id obj = [def objectForKey:key];
// These must be NSData.
if ([obj isKindOfClass:[NSString class]])
{
NSLog(@"Removed dodgy %@ key from NSUSerDefaults", key);
[def removeObjectForKey: key];
[def synchronize];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment