iOS 8 - show incoming call when app is not active (without CallKit)

190 Views Asked by At

I received incoming call requests using PushKit/VoIP. The problem is I cannot launch the app to show incoming call screen since CallKit is not available prior to iOS 10. I have succeeded to show notifications but how can I launch the app from background?

Here is my code:

 func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) {
    if (pushCredentials.type == .voIP) {
        let pkToken = (pushCredentials.token as NSData).description
        SocketManager.shared.send(pkToken: pkToken)
    }
}


func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType) {
    let payloadDict = payload.dictionaryPayload["aps"] as? Dictionary<String, String>
    let message = payloadDict?["alert"]


    Notifications.present(id: "test", title: "test", body: message)
    NSLog("incoming voip notfication 1: \(payload.dictionaryPayload)")
}
0

There are 0 best solutions below