EddyVerbruggen / nativescript-call

NativeScript plugin to interact with the native Call UI
Apache License 2.0
8 stars 4 forks source link

Callkit screen not loaded while app is not running #5

Closed brendtumi closed 5 years ago

brendtumi commented 5 years ago

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Create callkit screen on pushkit request while app is not running.

EddyVerbruggen commented 5 years ago

Hi @brendtumi, thanks for providing a testbed with #6. The only problem I had with it is that I never received a push token. It turned out there was an entitlements file missing which I've now pushed to the demo app in this repo.

With the token available I was able to push a test payload to my device with the Pusher app:

Screenshot 2019-05-16 at 11 51 02

This revealed the issue you reported here. After Googling a little it turned out to be an iOS 12 issue, where Callkit gets stuck if you immediately invoke the completion handler of the pushRegistryDidReceiveIncomingPushWithPayloadForTypeWithCompletionHandler delegate function. So the only change that was needed to your code is delaying invocation of the completion handler until after the Promise of tnsCall.receiveCall resolves.

The demo app has been updated accordingly, please let me know if you run into any other issues.