浏览代码

dev push notification

Marino Faggiana 6 年之前
父节点
当前提交
7a967247d7
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      iOSClient/AppDelegate.h
  2. 3 1
      iOSClient/AppDelegate.m

+ 1 - 1
iOSClient/AppDelegate.h

@@ -161,7 +161,7 @@
 
 // Push Notification
 - (void)subscribingNextcloudServerPushNotification;
-- (void)unsubscribingNextcloudServerPushNotification;
+- (void)unsubscribingNextcloudServerPushNotification:(BOOL)withSubscribing;
 
 // Theming Color
 - (void)settingThemingColorBrand;

+ 3 - 1
iOSClient/AppDelegate.m

@@ -428,7 +428,7 @@
     }];
 }
 
-- (void)unsubscribingNextcloudServerPushNotification
+- (void)unsubscribingNextcloudServerPushNotification:(BOOL)withSubscribing
 {
     if (self.pnDeviceIdentifier == nil || self.pnDeviceIdentifierSignature == nil || self.pnPublicKey == nil)
         return;
@@ -437,6 +437,8 @@
 
     [ocNetworking unsubscribingPushNotificationServer:self.activeUrl deviceIdentifier:self.pnDeviceIdentifier deviceIdentifierSignature:self.pnDeviceIdentifierSignature publicKey:self.pnPublicKey success:^{
         NSLog(@"[LOG] Unsubscribed to Push Notification server & proxy successfully.");
+        if (withSubscribing)
+            [self subscribingNextcloudServerPushNotification];
     } failure:^(NSString *message, NSInteger errorCode) {
         NSLog(@"[LOG] Unsubscribed to Push Notification server & proxy successfully.");
     }];