From dbab6ab54c40a016f75e75a4143576c3fa41c3e0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 1 Oct 2019 17:29:46 +0300 Subject: Drop AFNetworking and SSKeychain --- Juick/AppDelegate.m | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'Juick/AppDelegate.m') 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"; -- cgit v1.2.3