From d7e9cf6234cd6a27a7f3e37e8f5a7bb7faebd532 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Mon, 30 Mar 2020 11:22:01 +0200 Subject: [PATCH] add logs for pushkit --- Classes/LinphoneAppDelegate.m | 6 ++++++ Resources/linphonerc | 1 + Resources/linphonerc~ipad | 2 ++ 3 files changed, 9 insertions(+) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 600f0e0b6..28f60b221 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -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]; diff --git a/Resources/linphonerc b/Resources/linphonerc index 97a80c1be..6be083e0f 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -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 diff --git a/Resources/linphonerc~ipad b/Resources/linphonerc~ipad index fd83bf5ce..be9b88eef 100644 --- a/Resources/linphonerc~ipad +++ b/Resources/linphonerc~ipad @@ -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