diff options
author | Vitaly Takmazov | 2019-10-01 17:29:46 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-10-01 22:14:59 +0300 |
commit | dbab6ab54c40a016f75e75a4143576c3fa41c3e0 (patch) | |
tree | 6fd5e68ec76c249fcaa07219c53ccab2f4c98fd5 /Juick/AppDelegate.m | |
parent | aeb513ed5c165e355c9c378efde7445f597d0380 (diff) |
Drop AFNetworking and SSKeychain
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r-- | Juick/AppDelegate.m | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 9501316..61c8da5 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -16,6 +16,7 @@ #import "DeviceRegistration.h" #import "NewPostViewController.h" #import "FeedViewController.h" +#import "NSData+Hex.h" NSString * const UserUpdatedNotificationName = @"UserUpdated"; @@ -40,13 +41,6 @@ NSString * const UserUpdatedNotificationName = @"UserUpdated"; NSDictionary *userInfo = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]; if (userInfo) { [self parseNotificationPayload:userInfo]; - } else { - if ([[NSUserDefaults standardUserDefaults] objectForKey:@"FirstRun"] == nil) { - [SAMKeychain deletePasswordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.username"]; - [SAMKeychain deletePasswordForService:[[NSBundle mainBundle] bundleIdentifier] account:@"com.juick.password"]; - [SAMKeychain setAccessibilityType:kSecAttrAccessibleAfterFirstUnlock]; - [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"FirstRun"]; - } } return YES; } @@ -64,8 +58,7 @@ NSString * const UserUpdatedNotificationName = @"UserUpdated"; } -(void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"<>"]]; - token = [token stringByReplacingOccurrencesOfString:@" " withString:@""]; + NSString *token = [deviceToken hexString]; [[NSOperationQueue new] addOperationWithBlock:^{ DeviceRegistration *registration = [DeviceRegistration new]; registration.type = @"apns"; |