我正在开发一个使用CallKit通知用户的应用程序.但是,我正在使用APN测试应用程序,但它无法正常工作.
流程应为:接收FCM - >使用Callkit创建呼叫 - >用户接受呼叫 - >执行某些操作.
流程类似于应用程序类似于什么,但我没有VOIP,我只需要确保CALLKIT激活每个时间都有一个FCM.
但是,目前,如果应用程序处于后台或非活动状态,则callkit将无法启动.
我正在考虑使用PushKit来实现它.但是,我没有使用PushKit的经验(并且不确定我的应用程序是否会被禁止,根据这篇文章:PushKit:我们可以在聊天应用程序中使用推送套件(VoiP推送)而无需使用VoiP
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
// If you are receiving a notification message while your app is in the background,
// this callback will not be fired till the user taps on the notification launching the application.
// TODO: Handle data of notification
// With swizzling disabled you must let Messaging know about the message, for Analytics
// …Run Code Online (Sandbox Code Playgroud)