首页 > 解决方案 > didReceiveIncomingPushWith - 不工作 - iOS

问题描述

我已经迅速实施了 VOIP。早些时候它工作正常。但是,现在它没有触发该didReceiveIncomingPushWith功能。

请找到我的配置

let config = CXProviderConfiguration.init(localizedName: "AppName")
var provider: CXProvider!



 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
   provider = CXProvider(configuration: config)
   provider.setDelegate(self, queue: DispatchQueue.main)
   self.registerVOIP()
}


 func registerVOIP()  {

        //register for voip notifications
        pushRegistry = PKPushRegistry(queue: DispatchQueue.main)
         pushRegistry.delegate = self;
        pushRegistry.desiredPushTypes = Set([PKPushType.voIP])

    }

extension AppDelegate : PKPushRegistryDelegate{
    func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {

    }

    func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) {


        }
   }

在扩展方法中,didUpdate工作正常,因为在 didiFinishLoad 中设置了委托

我正在使用 QuickBlox 进行 VOIP 我检查了 voip 证书一切都很好。

这里是快速框新会话代表

extension AppDelegate : QBRTCClientDelegate{

    func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
        print(#function)

    }
}

the didReceiveNewSession  function is trigger when receives a new call (If the app is in foreground)

标签: iosvoipquickbloxpushkit

解决方案


您的代码很好,它是 Quickblox 服务器端代码需要更改。


推荐阅读