|
@@ -744,18 +744,25 @@ NSString const *OCWebDAVModificationDateKey = @"modificationdate";
|
|
|
_requestMethod = @"POST";
|
|
|
|
|
|
NSString *pushTokenHashParam = [NSString stringWithFormat:@"?pushTokenHash=%@",pushTokenHash];
|
|
|
- NSString *devicePublicKeyParam = [NSString stringWithFormat:@"devicePublicKey=%@",devicePublicKey];
|
|
|
+
|
|
|
+ //NSString *devicePublicKeyParam = [NSString stringWithFormat:@"&devicePublicKey=%@",devicePublicKey];
|
|
|
+
|
|
|
+ NSString *devicePublicKeyParam = @"&devicePublicKey=-----BEGIN%20PUBLIC%20KEY-----%0AMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAta6rACLhMTSBcixmPBUM%0AH5xQgHqmj6n8FQ77CBhzbmalg6fUnbTKXNXx0OJjv%2FaokO16z6Sh1rlVTVBj9sqI%0ATjuVnWn1VjORjbITF1bfF1IiACTPzhYMBAbbCxLHHR4XysM7YN52E%2FMgjMojr4OQ%0AZa9Z%2BW2PXE0Ut7Qq8zIMoTW7x5XQ5RFyLsoUUDvVc6sM08zX3M5tKRmwTxIYjiaF%0An12dqqioxnp8W6cih%2FGUiusJSEkjKj6uo0Dv9xsx3UFYifB8bCVja6zgak6uNQXJ%0Ax8wm6GzH%2FvsYyTRd8ayqiP5yrGKUqUWQEWGWMnvnYxR2UBkoIzjz3Q5gYLGpmsCR%0A3wIDAQAB%0A-----END%20PUBLIC%20KEY-----";
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ devicePublicKeyParam = [devicePublicKeyParam substringToIndex:[devicePublicKeyParam length] -1];
|
|
|
+ devicePublicKeyParam = [devicePublicKeyParam stringByReplacingOccurrencesOfString:@"\n" withString:@"%0A"]; // %0A
|
|
|
+ devicePublicKeyParam = [devicePublicKeyParam stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"]; // %2F
|
|
|
+ devicePublicKeyParam = [devicePublicKeyParam stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"];
|
|
|
+ */
|
|
|
|
|
|
serverPath = [serverPath stringByAppendingString:pushTokenHashParam];
|
|
|
- //serverPath = [serverPath stringByAppendingString:devicePublicKeyParam];
|
|
|
-
|
|
|
+ serverPath = [serverPath stringByAppendingString:devicePublicKeyParam];
|
|
|
+
|
|
|
NSMutableURLRequest *request = [self sharedRequestWithMethod:_requestMethod path:serverPath parameters:nil];
|
|
|
[request setValue:[NSString stringWithFormat:@"token %@", authorizationToken] forHTTPHeaderField:@"Authorization"];
|
|
|
|
|
|
- NSData *requestBodyData = [devicePublicKeyParam dataUsingEncoding:NSUTF8StringEncoding];
|
|
|
-
|
|
|
- request.HTTPBody = requestBodyData;
|
|
|
-
|
|
|
OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication success:success failure:failure];
|
|
|
[self setRedirectionBlockOnDatataskWithOCCommunication:sharedOCCommunication andSessionManager:sharedOCCommunication.networkSessionManager];
|
|
|
[operation resume];
|