Skip to content

Commit c129a9f

Browse files
Merge pull request #137 from ConnectyCube/development
Release 2.7.0
2 parents b723f25 + f6a8251 commit c129a9f

File tree

5 files changed

+29
-15
lines changed

5 files changed

+29
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.7.0
2+
- Implemented closing of the iOS CallKit by VoIP push notification where `signal_type` is 'endCall' or 'rejectCall';
3+
14
## 2.6.0
25
- Implemented the Notify for Incoming Calls feature (thanks for [tungs0ul](https://github.com/tungs0ul));
36

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.connectycube.flutter.connectycube_flutter_call_kit'
2-
version '2.6.0'
2+
version '2.7.0'
33

44
buildscript {
55
ext.kotlin_version = '1.9.10'

ios/Classes/VoIPController.swift

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,34 @@ extension VoIPController: PKPushRegistryDelegate {
5656

5757
if type == .voIP{
5858
let callId = callData["session_id"] as! String
59-
let callType = callData["call_type"] as! Int
60-
let callInitiatorId = callData["caller_id"] as! Int
61-
let callInitiatorName = callData["caller_name"] as! String
62-
let callOpponentsString = callData["call_opponents"] as! String
63-
let callOpponents = callOpponentsString.components(separatedBy: ",")
64-
.map { Int($0) ?? 0 }
65-
let userInfo = callData["user_info"] as? String
59+
let signalingType = callData["signal_type"] as? String
6660

67-
self.callKitController.reportIncomingCall(uuid: callId.lowercased(), callType: callType, callInitiatorId: callInitiatorId, callInitiatorName: callInitiatorName, opponents: callOpponents, userInfo: userInfo) { (error) in
61+
if (signalingType != nil && (signalingType == "endCall" || signalingType == "rejectCall")) {
62+
self.callKitController.reportCallEnded(uuid: UUID(uuidString: callId.lowercased())!, reason: CallEndedReason.remoteEnded)
6863

6964
completion()
65+
} else if (signalingType != nil && signalingType == "startCall") {
66+
let callType = callData["call_type"] as! Int
67+
let callInitiatorId = callData["caller_id"] as! Int
68+
let callInitiatorName = callData["caller_name"] as! String
69+
let callOpponentsString = callData["call_opponents"] as! String
70+
let callOpponents = callOpponentsString.components(separatedBy: ",")
71+
.map { Int($0) ?? 0 }
72+
let userInfo = callData["user_info"] as? String
7073

71-
if(error == nil){
72-
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall SUCCESS")
73-
} else {
74-
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall ERROR: \(error?.localizedDescription ?? "none")")
74+
self.callKitController.reportIncomingCall(uuid: callId.lowercased(), callType: callType, callInitiatorId: callInitiatorId, callInitiatorName: callInitiatorName, opponents: callOpponents, userInfo: userInfo) { (error) in
75+
76+
completion()
77+
78+
if(error == nil){
79+
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall SUCCESS")
80+
} else {
81+
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall ERROR: \(error?.localizedDescription ?? "none")")
82+
}
7583
}
84+
} else {
85+
print("[VoIPController][didReceiveIncomingPushWith] unknown 'signal_type' was received")
86+
completion()
7687
}
7788
} else {
7889
completion()

ios/connectycube_flutter_call_kit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'connectycube_flutter_call_kit'
7-
s.version = '2.6.0'
7+
s.version = '2.7.0'
88
s.summary = 'Connectycube Call Kit plugin for flutter.'
99
s.description = <<-DESC
1010
Connectycube Call Kit plugin for flutter.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: connectycube_flutter_call_kit
22
description: A Flutter plugin for displaying call screen when app in background or terminated.
3-
version: 2.6.0
3+
version: 2.7.0
44
homepage: https://connectycube.com/
55
issue_tracker: https://github.com/ConnectyCube/connectycube-flutter-call-kit/issues
66
documentation: https://github.com/ConnectyCube/connectycube-flutter-call-kit/blob/master/README.md

0 commit comments

Comments
 (0)