admin管理员组文章数量:1201801
call ended automatically after 2-3 seconds when receive a voip notification in the terminated case
and this is my code:-
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
guard type == .voIP else { return }
let typeStr = payload.dictionaryPayload["type"] as? String ?? ""
if typeStr == "call_audio" {
print("PushKit - didReceiveIncomingPushWith: \(payload.dictionaryPayload)")
let uuidStr = payload.dictionaryPayload["uuid"] as? String ?? ""
let id = payload.dictionaryPayload["id"] as? String ?? ""
let nameCaller = payload.dictionaryPayload["callerName"] as? String ?? ""
let handle = payload.dictionaryPayload["handle"] as? String ?? ""
let data = flutter_callkit_incoming.Data(id: uuidStr, nameCaller: nameCaller, handle: "Incoming Call",type: 0)
data.extra = ["platform": "ios", "type":type, "uuid": id, "callerName": nameCaller, "handle": handle, "isVideo": false,"id": id]
data.appName="Randomly"
data.uuid=uuidStr
data.nameCaller=nameCaller
data.duration=60000
data.type=0
data.handleType="email"
data.supportsDTMF=false
data.supportsGrouping=false
data.audioSessionMode="voiceChat"
data.audioSessionPreferredSampleRate=44100
data.audioSessionPreferredIOBufferDuration=0.005
data.audioSessionActive=true
data.maximumCallsPerCallGroup=1
data.supportsHolding=false
data.supportsUngrouping=false
data.maximumCallGroups=1
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.showCallkitIncoming(data, fromPushKit: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
completion()
}
}
else if typeStr == "missed_call" {
SwiftFlutterCallkitIncomingPlugin.sharedInstance?.endAllCalls()
completion()
}
}
after I close the app (be terminated) the issue happened and if I receive another call this will work as expected so this issue happened in first time I receive call after being terminated that the call ended immediately after 2-3 sec how can I solve this?
本文标签: swiftFlutterCallkitIncomingCall issue with iOS in terminated caseStack Overflow
版权声明:本文标题:swift - FlutterCallkitIncomingCall issue with iOS in terminated case - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738574468a2100792.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论