marinofaggiana 6 rokov pred
rodič
commit
6715191c16
2 zmenil súbory, kde vykonal 8 pridanie a 5 odobranie
  1. 3 0
      iOSClient/AppDelegate.h
  2. 5 5
      iOSClient/AppDelegate.m

+ 3 - 0
iOSClient/AppDelegate.h

@@ -83,6 +83,9 @@
 @property (nonatomic, strong) AVPlayer *player;
 @property (nonatomic, strong) AVPlayerViewController *playerController;
 
+// Push Norification Token
+@property (nonatomic, strong) NSString *pushKitToken;
+
 // Remenu
 @property (nonatomic, strong) REMenu *reMainMenu;
 @property (nonatomic, strong) REMenuItem *selezionaItem;

+ 5 - 5
iOSClient/AppDelegate.m

@@ -563,15 +563,15 @@ PKPushRegistry *pushRegistry;
     if (self.activeAccount.length == 0 || self.maintenanceMode)
         return;
     
-    NSString *pushKitToken = [self stringWithDeviceToken:credentials.token];
+    self.pushKitToken = [self stringWithDeviceToken:credentials.token];
 
     NSString *token = [CCUtility getPushNotificationToken:self.activeAccount];
-    if (![token isEqualToString:pushKitToken]) {
+    if (![token isEqualToString:self.pushKitToken]) {
         if (token != nil) {
             // unsubscribing + subscribing
-            [self unsubscribingNextcloudServerPushNotification:self.activeAccount url:self.activeUrl token:pushKitToken];
+            [self unsubscribingNextcloudServerPushNotification:self.activeAccount url:self.activeUrl token:self.pushKitToken];
         } else {
-            [self subscribingNextcloudServerPushNotification:self.activeAccount url:self.activeUrl token:pushKitToken];
+            [self subscribingNextcloudServerPushNotification:self.activeAccount url:self.activeUrl token:self.pushKitToken];
         }
     }
 }
@@ -599,7 +599,7 @@ PKPushRegistry *pushRegistry;
                         content.title = @"Nextcloud Talk";
                     } else {
                         content.title = app.capitalizedString;
-                    }                    
+                    }
                     if (subject) {
                         content.body = subject;
                     } else {