Skip to content

Commit

Permalink
#457 - Fixed failure with unregistering push notifications (fixed in …
Browse files Browse the repository at this point in the history
…develop)
  • Loading branch information
astralbodies committed Nov 29, 2013
1 parent ccb2376 commit b8ae036
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WordPress/WordPressApi/WordPressComApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ - (void)signOut {
WPFLogMethod();
NSError *error = nil;

[[WordPressAppDelegate sharedWordPressApplicationDelegate] unregisterApnsToken];
[WordPressAppDelegate sharedWordPressApplicationDelegate].isWPcomAuthenticated = NO;

[SFHFKeychainUtils deleteItemForUsername:self.username andServiceName:@"WordPress.com" error:&error];
[SFHFKeychainUtils deleteItemForUsername:self.username andServiceName:kWPcomXMLRPCUrl error:&error];

[[WordPressAppDelegate sharedWordPressApplicationDelegate] unregisterApnsToken];
[WordPressAppDelegate sharedWordPressApplicationDelegate].isWPcomAuthenticated = NO;
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kApnsDeviceTokenPrefKey]; //Remove the token from Preferences, otherwise the token is never sent to the server on the next login
[SFHFKeychainUtils deleteItemForUsername:self.username andServiceName:WordPressComApiOauthServiceName error:&error];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"wpcom_username_preference"];
Expand Down

0 comments on commit b8ae036

Please sign in to comment.