Search code examples
swiftvoipcallkitpushkit

Swift - Can I use PushKit but don't make a call?


As the title, I just want to receive a VoIP message, then do something.

But it seems to be necessary to do reportNewIncomingCall in didReceiveIncomingPushWith, and it will make the caller scene shows up.

Can I cancel the call before it shows up ?


Solution

  • Can I cancel the call before it shows up?

    No.

    Generally, any computation from a push notification should inform the user for security purposes. As pushkit wakes up the main app for computation compared to the normal push which wakes only notification extension, it does have more restrictions, for example, callkit UI must be shown to the user.

    By default, for any push notification regardless of VOIP or other, it must present a notification to the user. From apple doc, to suppress showing notifications when using pushkit you must have com.apple.developer.user notifications.filtering capabilities.

    As a result, hiding notifications and showing callkit with the above-mentioned capability will require extra permission from apple.

    However, one way can be a silent push, but that is limited to two or three per hour.