Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions ios/RNVoipPushNotification/RNVoipPushNotificationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ - (void)voipRegistration
NSLog(@"[RNVoipPushNotificationManager] voipRegistration");

dispatch_queue_t mainQueue = dispatch_get_main_queue();
// Create a push registry object
PKPushRegistry * voipRegistry = [[PKPushRegistry alloc] initWithQueue: mainQueue];
// Set the registry's delegate to AppDelegate
voipRegistry.delegate = (RNVoipPushNotificationManager *)RCTSharedApplication().delegate;
// Set the push type to VoIP
voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
dispatch_async(mainQueue, ^{
// Create a push registry object
PKPushRegistry * voipRegistry = [[PKPushRegistry alloc] initWithQueue: mainQueue];
// Set the registry's delegate to AppDelegate
voipRegistry.delegate = (RNVoipPushNotificationManager *)RCTSharedApplication().delegate;
// Set the push type to VoIP
voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
});
}

- (NSDictionary *)checkPermissions
Expand Down Expand Up @@ -193,8 +195,10 @@ - (void)handleRemoteNotificationReceived:(NSNotification *)notification
if (RCTRunningInAppExtension()) {
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
[self registerUserNotification:permissions];
[self voipRegistration];
});
}

RCT_EXPORT_METHOD(checkPermissions:(RCTResponseSenderBlock)callback)
Expand Down