Skip to content

Commit

Permalink
Check if publicKey, deviceIdentifier and signature are received when …
Browse files Browse the repository at this point in the history
…subscribing for push notifications in NC.

Signed-off-by: Ivan Sein <[email protected]>
  • Loading branch information
Ivansss committed Jul 20, 2023
1 parent 45fbbf2 commit d6451a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions NextcloudTalk/NCSettingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,17 @@ - (void)subscribeForPushNotificationsForAccountId:(NSString *)accountId withComp
NSString *deviceIdentifier = [responseDict objectForKey:@"deviceIdentifier"];
NSString *signature = [responseDict objectForKey:@"signature"];

if (!publicKey || !deviceIdentifier || !signature) {
[NCUtils log:@"Something went wrong subscribing to NC server. Aborting subscribe to Push Notification server."];

if (block) {
block(NO);
}

[bgTask stopBackgroundTask];
return;
}

RLMRealm *realm = [RLMRealm defaultRealm];
[realm beginWriteTransaction];
NSPredicate *query = [NSPredicate predicateWithFormat:@"accountId = %@", accountId];
Expand Down

0 comments on commit d6451a0

Please sign in to comment.