add logs for pushkit

This commit is contained in:
Danmei Chen 2020-03-30 11:22:01 +02:00
parent 763d56a0bc
commit d7e9cf6234
3 changed files with 9 additions and 0 deletions

View file

@ -163,6 +163,11 @@
LOGI(@"[PushKit] Connecting for push notifications");
self.voipRegistry.desiredPushTypes = [NSSet setWithObject:PKPushTypeVoIP];
int num = [LinphoneManager.instance lpConfigIntForKey:@"unexpected_pushkit" withDefault:0];
if (num > 2) {
LOGW(@"[PushKit] unexpected pushkit notifications received %d, please clean your sip account.", num);
}
[[UIApplication sharedApplication] unregisterForRemoteNotifications];
// Register for remote notifications.
LOGI(@"[APNs] register for push notif");
[[UIApplication sharedApplication] registerForRemoteNotifications];
@ -542,6 +547,7 @@
// prevent app to crash if PushKit received for msg
if ([userInfo[@"aps"][@"loc-key"] isEqualToString:@"IM_MSG"]) {
LOGE(@"Received a legacy PushKit notification for a chat message");
[LinphoneManager.instance lpConfigSetInt:[LinphoneManager.instance lpConfigIntForKey:@"unexpected_pushkit" withDefault:0]+1 forKey:@"unexpected_pushkit"];
return;
}
[LinphoneManager.instance startLinphoneCore];

View file

@ -18,6 +18,7 @@ auto_download_incoming_files_max_size=0
lime_migration_done=0
use_rls_presence=1
use_callkit=1
unexpected_pushkit=0
[in_app_purchase]
#set to 1 if in-app purchases are to be shown in the application

View file

@ -13,6 +13,8 @@ start_at_boot_preference=1
stun_preference=stun.linphone.org
voiceproc_preference=1
repeat_call_notification=1
use_callkit=1
unexpected_pushkit=0
[default_values]
reg_expires=1314000