Explorar el Código

dev push notification

Marino Faggiana hace 7 años
padre
commit
7a967247d7
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  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.");
     }];