summaryrefslogtreecommitdiff
path: root/Juick/AppDelegate.m
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-03-20 02:35:23 +0300
committerGravatar Vitaly Takmazov2019-03-20 02:35:23 +0300
commit458e55b9cddcadb2bbbe3fb4002f06a5744b84c0 (patch)
treeaa32d167c3a6914b1fd326085e94d2a2cb43b057 /Juick/AppDelegate.m
parent1f3e08f107064fa429c6aa2a26702f6e63a791f0 (diff)
Move all API calls to APIClient
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);
+ }
+ }];
}];
}