mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
update pushkit API
This commit is contained in:
parent
557eca0821
commit
bf34895c91
1 changed files with 16 additions and 14 deletions
|
|
@ -536,30 +536,32 @@
|
|||
|
||||
#pragma mark - PushKit Functions
|
||||
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry didUpdatePushCredentials:(PKPushCredentials *)credentials forType:(PKPushType)type {
|
||||
LOGI(@"PushKit credentials updated");
|
||||
LOGI(@"voip token: %@", (credentials.token));
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[LinphoneManager.instance setPushNotificationToken:credentials.token];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry
|
||||
didInvalidatePushTokenForType:(NSString *)type {
|
||||
LOGI(@"PushKit Token invalidated");
|
||||
dispatch_async(dispatch_get_main_queue(), ^{[LinphoneManager.instance setPushNotificationToken:nil];});
|
||||
}
|
||||
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry
|
||||
didReceiveIncomingPushWithPayload:(PKPushPayload *)payload
|
||||
forType:(NSString *)type {
|
||||
|
||||
#ifdef __IPHONE_11_0
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {
|
||||
#else
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(NSString *)type {
|
||||
#endif
|
||||
LOGI(@"PushKit : incoming voip notfication: %@", payload.dictionaryPayload);
|
||||
[LinphoneManager.instance setupNetworkReachabilityCallback];
|
||||
//to avoid IOS to suspend the app before being able to launch long running task
|
||||
[self processRemoteNotification:payload.dictionaryPayload];
|
||||
}
|
||||
|
||||
- (void)pushRegistry:(PKPushRegistry *)registry
|
||||
didUpdatePushCredentials:(PKPushCredentials *)credentials
|
||||
forType:(PKPushType)type {
|
||||
LOGI(@"PushKit credentials updated");
|
||||
LOGI(@"voip token: %@", (credentials.token));
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[LinphoneManager.instance setPushNotificationToken:credentials.token];
|
||||
});
|
||||
#ifdef __IPHONE_11_0
|
||||
dispatch_async(dispatch_get_main_queue(), ^{completion();});
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - UNUserNotifications Framework
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue