ios - 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)
解决方案
您的代码很好,它是 Quickblox 服务器端代码需要更改。
推荐阅读
- sql - EXTENDED STATISTICS 对 PostgreSQL 中的 INSERT/UPDATE/DELETE 有影响吗?
- java - 从数组列表中打印随机价格标签
- python - 为什么keras损失函数会降维?
- swift - CoreData:违背苹果推荐实现描述方法的错误
- java - 如何使用 when() 解决这个 Mockito MissingMethodInvocationException ...?
- vue.js - 从父 vue 组件上的按钮调用子方法
- postgresql - 在视图中输入数据时创建 SQL 触发器以更新表
- gluon - Gluon Client Plugin Android 应用程序的大小真的很大
- azure-devops - 用于运行两个或更多独立管道的 Azure 管道
- c++ - Stack Linked List pop() 和 isEmpty() 不起作用,不知道错误在哪里