From b8ae036d81a539666fc0485498ee425be8874b71 Mon Sep 17 00:00:00 2001 From: Aaron Douglas Date: Fri, 29 Nov 2013 09:20:05 -0600 Subject: [PATCH] #457 - Fixed failure with unregistering push notifications (fixed in develop) --- WordPress/WordPressApi/WordPressComApi.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/WordPress/WordPressApi/WordPressComApi.m b/WordPress/WordPressApi/WordPressComApi.m index a65d3983ebba..9cf1dd13b850 100644 --- a/WordPress/WordPressApi/WordPressComApi.m +++ b/WordPress/WordPressApi/WordPressComApi.m @@ -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"];