Skip to content

Commit

Permalink
Merge pull request #137 from ConnectyCube/development
Browse files Browse the repository at this point in the history
Release 2.7.0
  • Loading branch information
TatankaConCube committed Feb 12, 2024
2 parents b723f25 + f6a8251 commit c129a9f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.7.0
- Implemented closing of the iOS CallKit by VoIP push notification where `signal_type` is 'endCall' or 'rejectCall';

## 2.6.0
- Implemented the Notify for Incoming Calls feature (thanks for [tungs0ul](https://github.com/tungs0ul));

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.connectycube.flutter.connectycube_flutter_call_kit'
version '2.6.0'
version '2.7.0'

buildscript {
ext.kotlin_version = '1.9.10'
Expand Down
35 changes: 23 additions & 12 deletions ios/Classes/VoIPController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,34 @@ extension VoIPController: PKPushRegistryDelegate {

if type == .voIP{
let callId = callData["session_id"] as! String
let callType = callData["call_type"] as! Int
let callInitiatorId = callData["caller_id"] as! Int
let callInitiatorName = callData["caller_name"] as! String
let callOpponentsString = callData["call_opponents"] as! String
let callOpponents = callOpponentsString.components(separatedBy: ",")
.map { Int($0) ?? 0 }
let userInfo = callData["user_info"] as? String
let signalingType = callData["signal_type"] as? String

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

completion()
} else if (signalingType != nil && signalingType == "startCall") {
let callType = callData["call_type"] as! Int
let callInitiatorId = callData["caller_id"] as! Int
let callInitiatorName = callData["caller_name"] as! String
let callOpponentsString = callData["call_opponents"] as! String
let callOpponents = callOpponentsString.components(separatedBy: ",")
.map { Int($0) ?? 0 }
let userInfo = callData["user_info"] as? String

if(error == nil){
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall SUCCESS")
} else {
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall ERROR: \(error?.localizedDescription ?? "none")")
self.callKitController.reportIncomingCall(uuid: callId.lowercased(), callType: callType, callInitiatorId: callInitiatorId, callInitiatorName: callInitiatorName, opponents: callOpponents, userInfo: userInfo) { (error) in

completion()

if(error == nil){
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall SUCCESS")
} else {
print("[VoIPController][didReceiveIncomingPushWith] reportIncomingCall ERROR: \(error?.localizedDescription ?? "none")")
}
}
} else {
print("[VoIPController][didReceiveIncomingPushWith] unknown 'signal_type' was received")
completion()
}
} else {
completion()
Expand Down
2 changes: 1 addition & 1 deletion ios/connectycube_flutter_call_kit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'connectycube_flutter_call_kit'
s.version = '2.6.0'
s.version = '2.7.0'
s.summary = 'Connectycube Call Kit plugin for flutter.'
s.description = <<-DESC
Connectycube Call Kit plugin for flutter.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: connectycube_flutter_call_kit
description: A Flutter plugin for displaying call screen when app in background or terminated.
version: 2.6.0
version: 2.7.0
homepage: https://connectycube.com/
issue_tracker: https://github.com/ConnectyCube/connectycube-flutter-call-kit/issues
documentation: https://github.com/ConnectyCube/connectycube-flutter-call-kit/blob/master/README.md
Expand Down

0 comments on commit c129a9f

Please sign in to comment.