Browse Source

add User Agent (SilentPush) for subscribingPushProxy

marinofaggiana 6 years ago
parent
commit
b773f018dd

+ 6 - 0
iOSClient/AppDelegate.m

@@ -536,6 +536,12 @@
     
     NSLog(@"FCM registration token: %@", fcmToken);
     
+    // sdcshdcvsdvcsdvgcusd
+    
+     [self subscribingNextcloudServerPushNotification:self.activeAccount url:self.activeUrl token:fcmToken];
+    // sgdvchsgdvcsdg
+    
+    
     NSString *token = [CCUtility getPushNotificationToken:self.activeAccount];
     if (![token isEqualToString:fcmToken]) {
         if (token != nil) {

+ 2 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -914,6 +914,8 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil timeout:k_timeout_webdav];
     
     [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
+    NSString *userAgent = [request valueForHTTPHeaderField:@"User-Agent"];
+    [request setValue:[userAgent stringByAppendingString:@" (SilentPush)"] forHTTPHeaderField:@"User-Agent"];
     
     OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
     [self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];

+ 3 - 3
iOSClient/Networking/OCNetworking.m

@@ -1586,9 +1586,9 @@
     
     devicePublicKey = [CCUtility URLEncodeStringFromString:devicePublicKey];
     NSString *proxyServerPath = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
-    //proxyServerPath = @"http://127.0.0.1:8088";
+    proxyServerPath = @"http://127.0.0.1:8088";
     NSString *proxyServer = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
-    //proxyServer = @"https://10.132.0.37:8443/pushnotifications";
+    proxyServer = @"https://10.132.0.37:8443/pushnotifications";
     
     OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;
     
@@ -1645,7 +1645,7 @@
     }
     
     NSString *proxyServer = [NCBrandOptions sharedInstance].pushNotificationServerProxy;
-    //proxyServer = @"https://10.132.0.37:8443/pushnotifications";
+    proxyServer = @"https://10.132.0.37:8443/pushnotifications";
     
     OCCommunication *communication = [OCNetworking sharedManager].sharedOCCommunication;