简体   繁体   English

使用 VOIP 杀死应用程序时如何获取呼叫通知

[英]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应用程序,呼叫通知在foregroundbackground工作正常,但是当我的应用程序处于Terminated/killed state 时,我没有收到任何呼叫通知。

  • didReceiveIncomingPushWith didReceiveIncomingPushWith
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()
                    

                }
                
            }
    }

Screenshot截屏

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.

相关问题 当用户杀死 iOS 应用程序时唤醒应用程序而不使用 VoIP - Awake application without using VoIP when user killed iOS application 当应用程序处于非活动状态时,带有 CallKit 的 VOIP 通知不会调用 reportIncomingCall state - VOIP notification with CallKit is not invoking reportIncomingCall when app is inactive killed state 如何在应用程序中获取voip通话记录信息 - Call Kit - How to get the voip call log information in application - Call Kit 当应用被杀死而不在IOS的后台运行时如何获取通知有效载荷 - How to get notification payload when app is killed not running in background in IOS iOS 10:如何在应用程序处于后台时显示传入的VOIP呼叫通知? - iOS 10: How to show incoming VOIP call notification when app is in background? 如果通话已经结束,如何忽略 iOS VoIP 通知? - How to ignore iOS VoIP notification if call has already ended? 当应用程序被杀死时,如何获取准确的位置更新? - How to get accurate location update when application is killed? 即使应用程序被杀死,如何获得设备锁定和解锁? - How to get device lock and unlock even when the application was killed? 当voip应用程序在后台被iOS杀死时,有没有办法得到通知并做一些最终工作? - When voip app was killed by iOS in background is there a way to get notified and do some final work? 我可以使用PushKit定期推出使用VoIP吗? 如果用户不对通知采取行动,是否会允许在后台启动被杀应用程序? - Can I use PushKit to do regular push with out using VoIP? Will it allow killed app to be launched in background if user does not act on notification?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM