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, 5 insertions, 6 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index 5aff686..f1afdc1 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -68,12 +68,11 @@
DeviceRegistration *registration = [DeviceRegistration new];
registration.type = @"apns";
registration.token = token;
- AFHTTPSessionManager *manager = [APIClient sharedClient].manager;
- [manager PUT:@"/notifications" parameters:@[[registration toJSON]] success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
- NSLog(@"success %@", token);
- } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
- NSLog(@"fail %@", [error localizedDescription]);
- } ];
+ [[APIClient sharedClient] refreshDeviceRegistration:registration callback:^(BOOL success) {
+ if (success) {
+ NSLog(@"successfully refreshed registration with %@", token);
+ }
+ }];
}];
}