Skip to content

Exposed the method reportEndCallWithUUID to handle a cancel VoIP Push Notification to tears down an incoming call #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 10, 2020

Conversation

mariouzae
Copy link
Contributor

@mariouzae mariouzae commented Mar 7, 2020

Hi,

I expose the method reportEndCallWithUUID for those who want to cancel an incoming call using a Push Notification on iOS. Does anyone think it's useful for most?

thanks,

Mario

@manuquentin
Copy link
Contributor

manuquentin commented Mar 10, 2020

Thanks @mariouzae, can you please rebase your PR ?

@mariouzae
Copy link
Contributor Author

Hi @manuquentin , done!

thanks.

@manuquentin manuquentin merged commit fd7010b into react-native-webrtc:master Mar 10, 2020
@ajnozari
Copy link
Contributor

Question, should the push notification to end the call come over regular push or should it also be a VOIP Push?

@mariouzae
Copy link
Contributor Author

I believe it is better to use regular push notification(background silent), Apple says if you don't report an incoming call screen many times, the APN's could stop sending the VoIP PN.

https://developer.apple.com/documentation/pushkit/pkpushregistrydelegate/2875784-pushregistry?language=objc#discussion

If you are using the project "react-native-voip-push-notification" look at this part of the doc:

https://github.com/react-native-webrtc/react-native-voip-push-notification#important-note

@ajnozari
Copy link
Contributor

So I tried going that route, but while the incoming call ui is being displayed but no new notifications are being received. I'm using RNFirebse, do I need to intercept the message in my AppDelegate.m and look for the specific notification to cancel the call?

@mariouzae
Copy link
Contributor Author

mariouzae commented Mar 22, 2020

Yes, if you want to close the incoming call ui for some reason, you must handle this "cancel pn" in the ApplDelegate.m. In my case, if the app receives an incoming call but it doesn't get registered on the server, I send this "cancel pn" to close the incoming call which I've created on the AppDelegate.

@ajnozari
Copy link
Contributor

@mariouzae thank you for your help, I ended up following you and exposed a method to check if the current call is the active call. I'm submitting a PR in case it helps others. However it is IOS only as it utilizes the CXCallObserver and like checkIfBusy it is an IOS only method. I went ahead and exposed it React Native as well.

This way you can intercept the Push notification and trigger the UI to cancel the incoming call but only if you're not actively in the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants