[英]How to get the call notification when application is killed using VOIP
I'm working with VOIP application, Call notification is working fine in foreground
and background
, But when my App is in Terminated/killed
state I'm not getting any Notification for Call .我正在使用VOIP应用程序,呼叫通知在foreground
和background
工作正常,但是当我的应用程序处于Terminated/killed
state 时,我没有收到任何呼叫通知。
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType)
{
print("payload is--->\(payload.dictionaryPayload)")
var strtypeofNotification : String = ""
let dictpayload = payload.dictionaryPayload as NSDictionary
let aps_dict = dictpayload["aps"] as? NSDictionary
let dict_body = aps_dict?["alert"] as? NSDictionary
let str_status = dict_body?["status"] as? String
let str_body = dict_body?["body"] as? String
let str_title = dict_body?["title"] as? String
LinphoneManager.instance()?.startLinphoneCore_second()
if Constants.isLogin == "1"
{
let arr = str_body?.components(separatedBy: ",") as! NSArray
let str_source = arr[0] as? String
let arr_source = str_source?.components(separatedBy: ":") as! NSArray
str_source_value = arr_source[1] as! String
if UIApplication.shared.applicationState == .active
{
strtypeofNotification = "Call"
}
else
{
// let call = aVoipManager.getCall()
}
}
}
If you are using voip notification in ios 13+ then you must use one method "ReportIncomingcall"如果您在 ios 13+ 中使用 voip 通知,那么您必须使用一种方法“ReportIncomingcall”
provider.reportNewIncomingCall(with: uuid, update: callUpdate){ (error) in
print("New Call reported")
if error == nil {
//Your code here
}
completion?(error)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.