Marino Faggiana 8 年之前
父節點
當前提交
cafd7e6c70

+ 1 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCCommunication.m

@@ -1543,7 +1543,7 @@
 - (void)subscribingPushProxy:(NSString *)serverPath pushToken:(NSString *)pushToken deviceIdentifier:(NSString *)deviceIdentifier deviceIdentifierSignature:(NSString *)deviceIdentifierSignature userPublicKey:(NSString *)userPublicKey onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void (^)(NSHTTPURLResponse *, NSString *))successRequest failureRequest:(void (^)(NSHTTPURLResponse *, NSError *, NSString *))failureRequest {
     
     serverPath = [serverPath encodeString:NSUTF8StringEncoding];
-    serverPath = [serverPath stringByAppendingString:k_url_acces_remote_subscribing_nextcloud_server_api];
+    serverPath = [serverPath stringByAppendingString:@"/device"];
     
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];

+ 5 - 4
iOSClient/Brand/CCNextcloudConstant.h

@@ -21,10 +21,11 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-#define _brand_                                         @"Nextcloud"
-#define _mail_me_                                       @"ios@nextcloud.com"
-#define _text_copyright_                                @"Nextcloud %@ © 2017 T.W.S. Inc."
-#define _login_base_url_                                @"https://cloud.twsweb.it"
+#define _brand_                         @"Nextcloud"
+#define _mail_me_                       @"ios@nextcloud.com"
+#define _text_copyright_                @"Nextcloud %@ © 2017 T.W.S. Inc."
+#define _login_base_url_                @"https://cloud.twsweb.it"
+#define _push_notification_server_      @"https://push-notifications.nextcloud.com"
 
 /* Define option compiler */
 

+ 3 - 5
iOSClient/Networking/OCNetworking.m

@@ -1244,12 +1244,10 @@
     
     [communication subscribingNextcloudServerPush:_activeUrl pushTokenHash:pushTokenHash devicePublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
         
-        static CFStringRef charset = CFSTR("!@#$%&*()+'\";:=,/?[] ");
-        CFStringRef str = (__bridge CFStringRef)publicKey;
-        CFStringEncoding encoding = kCFStringEncodingUTF8;
-        publicKey = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL, str, NULL, charset, encoding));
+        deviceIdentifier = [self URLEncodeStringFromString:deviceIdentifier];
+        signature = [self URLEncodeStringFromString:signature];
     
-        [communication subscribingPushProxy:_activeUrl pushToken:pushTokenHash deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
+        [communication subscribingPushProxy:_push_notification_server_ pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
             
             NSLog(@"OK");