|
@@ -429,13 +429,20 @@
|
|
|
NSDictionary *keys = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:k_nextcloudDevicePushKey ofType:@"plist"]];
|
|
|
|
|
|
NSString *devicePublicKey = [keys objectForKey:@"devicePublicKey"];
|
|
|
- NSString *deviceTokenString = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];
|
|
|
- NSLog(@"DEVICE TOKEN = %@", deviceTokenString);
|
|
|
- NSLog(@"DEVICE PUBLIC KEY = %@", devicePublicKey);
|
|
|
+ NSString *pushTokenString = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] stringByReplacingOccurrencesOfString: @">" withString: @""] stringByReplacingOccurrencesOfString: @" " withString: @""];
|
|
|
+ NSString *pushTokenHash = [[CCCrypto sharedManager] createSHA512:pushTokenString];
|
|
|
|
|
|
+ NSLog(@"DEVICE TOKEN = %@", pushTokenString);
|
|
|
+ NSLog(@"DEVICE PUBLIC KEY = %@", devicePublicKey);
|
|
|
|
|
|
- if ([devicePublicKey length] > 0 && [deviceTokenString length] > 0) {
|
|
|
+ if ([devicePublicKey length] > 0 && [pushTokenHash length] > 0) {
|
|
|
+
|
|
|
+ CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
|
|
|
+ NSDictionary *options = [[NSDictionary alloc] initWithObjectsAndKeys:pushTokenHash,@"pushTokenHash", devicePublicKey, @"devicePublicKey", nil];
|
|
|
|
|
|
+ metadataNet.action = actionSubscribingNextcloudServer;
|
|
|
+ metadataNet.options = options;
|
|
|
+ [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
|
|
|
}
|
|
|
}
|
|
|
|