summaryrefslogtreecommitdiff
path: root/Juick/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r--Juick/AppDelegate.m11
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";