From 6704c0fdcbfb835cac8df968a648608f24043051 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 10 Aug 2020 17:56:45 +0200 Subject: [PATCH] Use appropriate certificate --- .../CallKitTutorial.xcodeproj/project.pbxproj | 4 +-- .../CallKitProviderDelegate.swift | 30 +++++-------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/swift/CallKitTutorial/CallKitTutorial.xcodeproj/project.pbxproj b/swift/CallKitTutorial/CallKitTutorial.xcodeproj/project.pbxproj index c79f66d..6f60586 100644 --- a/swift/CallKitTutorial/CallKitTutorial.xcodeproj/project.pbxproj +++ b/swift/CallKitTutorial/CallKitTutorial.xcodeproj/project.pbxproj @@ -373,7 +373,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.belledonne.Wtest; + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.callkit; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -395,7 +395,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.belledonne.Wtest; + PRODUCT_BUNDLE_IDENTIFIER = org.linphone.tutorials.callkit; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/swift/CallKitTutorial/CallKitTutorial/CallKitProviderDelegate.swift b/swift/CallKitTutorial/CallKitTutorial/CallKitProviderDelegate.swift index a654c46..075ec48 100644 --- a/swift/CallKitTutorial/CallKitTutorial/CallKitProviderDelegate.swift +++ b/swift/CallKitTutorial/CallKitTutorial/CallKitProviderDelegate.swift @@ -39,15 +39,6 @@ class CallKitProviderDelegate : NSObject } - func incomingCall() { - incomingCallUUID = UUID() - let update = CXCallUpdate() - update.remoteHandle = CXHandle(type:.generic, value: tutorialContext.incomingCallName) - update.hasVideo = tutorialContext.videoEnabled - - provider.reportNewIncomingCall(with: incomingCallUUID, update: update, completion: { error in }) - } - func outgoingCall() { outgoingCallUUID = UUID() @@ -137,17 +128,11 @@ extension CallKitProviderDelegate: CXProviderDelegate { extension CallKitProviderDelegate: PKPushRegistryDelegate { func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) { - print("PushTrace -- pushRegistry 1") - /* let deviceTokenString = pushCredentials.token.map { String(format: "%02x", $0) }.joined() /*convert push tocken into hex string to be compliant with flexisip format*/ let aStr = String(format: "pn-provider=apns.dev;pn-prid=%@:voip;pn-param=Z2V957B3D6.org.linphone.tutorials.callkit.voip" ,deviceTokenString) - */ - let deviceTokenString = pushCredentials.token.map { String(format: "%02x", $0) }.joined() /*convert push tocken into hex string to be compliant with flexisip format*/ - let aStr = String(format: "pn-provider=apns.dev;pn-prid=%@:voip;pn-param=Z2V957B3D6.com.belledonne.Wtest.voip" - ,deviceTokenString) - + tutorialContext.proxy_cfg.edit() tutorialContext.proxy_cfg.pushNotificationAllowed = true tutorialContext.proxy_cfg.contactUriParameters = aStr @@ -160,12 +145,11 @@ extension CallKitProviderDelegate: PKPushRegistryDelegate { } func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { - print("PushTrace -- pushRegistry 2") - incomingCall(); - } - - func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor: PKPushType) - { - print("PushTrace -- pushRegistry 3") + incomingCallUUID = UUID() + let update = CXCallUpdate() + update.remoteHandle = CXHandle(type:.generic, value: tutorialContext.incomingCallName) + update.hasVideo = tutorialContext.videoEnabled + + provider.reportNewIncomingCall(with: incomingCallUUID, update: update, completion: { error in }) } }