Skip to content

Instantly share code, notes, and snippets.

@mafellows
Created July 31, 2015 16:07
Show Gist options
  • Save mafellows/9b78449a91e5b2668c93 to your computer and use it in GitHub Desktop.
Save mafellows/9b78449a91e5b2668c93 to your computer and use it in GitHub Desktop.
if ([PFUser currentUser]) {
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
NSString *userId = currentInstallation[@"installationUser"];
if (![userId isEqualToString:[[PFUser currentUser] objectId]]) {
currentInstallation[@"installationUser"] = [[PFUser currentUser] objectId];
[currentInstallation saveEventually];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment