-
Notifications
You must be signed in to change notification settings - Fork 459
[ios-13] add new class method to report incoming call when receiving voip push #86
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
Conversation
I believe you're the one who answered my question in the other repository, thank you so much for this!!!!! |
Plan on implementing this branch sometime in the next week due to impending
ios13. Need a device capable of running ios13 to test on 😂
…On Fri, 30 Aug 2019, 01:51 Andre Nozari, ***@***.***> wrote:
I believe you're the one who answered my question in the other repository,
thank you so much for this!!!!!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#86?email_source=notifications&email_token=AAB3LLOEGPJDT53UJFOUOYDQHBOHHA5CNFSM4IPROZKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QEEFY#issuecomment-526402071>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB3LLOUZFWZO3XFCMFSSSLQHBOHHANCNFSM4IPROZKA>
.
|
I can load iOS 13 on my test device later and test it for you if you want? |
This needs to be prioritized and tested. My other non-react-native app is getting killed b/c I wasn't calling CallKit's reportIncomingCall method fast enough. It's going to bite RN apps built against Xcode 11 too. |
+1. Please increase priority. Incoming Calls not working with CallKeep on iOS 13. |
So the fix that @r0b0t3d suggested seems to work fine in my app. |
I'll update my phone and test on my side also. I'll merge and publish a version if it's ok. |
Thanks @manuquentin. @bhuangy is working on it here today too. |
Currently buying a phone capable of ios 13. Yes. I am delayed! |
Hi @r0b0t3d, since we're testing on ios 13 we didn't receive any notification, due an error :
Even if we send How did you manage to send push since ios 13 ? |
@manuquentin I used node-apn to send push from firebase cloud functions. Below are my code
|
Check your certificate and that you're actually using the right device ID. |
Ok so I can confirm that your changes work, you have to do some fiddling with the Caller Name and UUID if you send it as part of the extraPayload or not in the aps, but
should work as it lets you specify the path to the key that you want. Same thing for callerName. |
Thanks @r0b0t3d for the PR, it's working 👌. The issue with the push is that you shouldn't send During my tests, I've experienced this error with JS debug activated :
I guess that's because in debug mode slows down the application and the I've made a little refactoring, as This will also send the |
@manuquentin I did add your commit |
This is brilliant guys, I’ll pull it and test out this fork later today, and will report back on success. |
Hi @ajnozari did you have time to check it today ? |
Yep and it seems all is good so far, I used this fork as well as the Webrtc’s master branch and both are working. This one is ringing on an iPhone 7 and XS max. Additionally the webrtc’s master branch fixed the random blank video shown on iOS. |
@danjenkins @manuquentin , |
Merged and deployed in |
@manuquentin , Thanks. I updated to version 3.0.3, but I am facing weird issue now. As soon as I accept the call my "endCall" method also get called first and then "answerCall" method get called. So my call gets end as soon I accept the call.
And as soon as I accept the call, here's the log what I get while debugging.
|
Hi @Chaitu4190 |
Oh yes @manuquentin , my bad. I was calling |
I spend all to day to make it working on foreground and background on iOS 13. |
@Chaitu4190 As the doc said
You can try to remove your app then reinstall as @ahmadworks suggest |
@r0b0t3d @ahmadworks After uninstalling and installing, call works fine now. |
This comment has been minimized.
This comment has been minimized.
@ahmadworks theres another PR open for that - #71 |
Hi, if you have issues with something different that this PR, can you open an issue ? |
@manuquentin , Generated new issue for outgoing call from call logs. Here's the link. |
For now, there is value
|
I try but have error "Use of undeclared identifier 'RNCallKeep'" |
@manhquyen
on top of |
@r0b0t3d Thanks for the work you did here! I am wondering what your thoughts are on handling a remote cancel-type event. For example: VoIP push comes in notifying app of incoming call, phone starts ringing, but what if the caller hangs up before the callee answers the call? I am thinking of a second push notification, but now that iOS is getting stricter with VoIP push, I am not sure on the best approach (especially in scenarios where the app is not running). What are your thoughts? |
@rcidt
Or another approach is websoket or a platform that provide realtime updates like Firebase Database, Firestore. |
@r0b0t3d why can't you use Pushkit in this instance? Pushkit isn't just for declaring a phone call is inbound; it's meant to be there for all voip necessities - I don't see any reason not to send another pushkit push informing of the cancel if you don't have an active websocket/messaging flow open to wherever. |
@danjenkins I haven't tried to use PushKit for hangs up event.
For
So I don't think we can use it for hangs up event (just my opinion). |
Yeah I can understand your reasoning now. But I'd also argue that their change in behaviour for callkit has now changed what we deem to be classed as data that "must report quickly to callkit" because a hangup/cancel is just as important as an invite/initiation. I'd just use pushkit with a cancel key in the payload. The worst that's going to happen is they change it in the future and you have to move to silent push. |
@r0b0t3d @danjenkins in the past we were using VoIP Push to send "status" update notifications like when a call has been ended or answered elsewhere, etc. Ever since applying the changes mentioned in this thread this functionality stopped working because of the fact that we start up an "incoming call" UI anytime a VoIP Push is received. So what I did was the following and our code now works as it used to. For now it seems that VoIP push will work for this type of functionality. - (void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion {
// Process the received push
[RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
NSString *uuid = [[NSUUID UUID] UUIDString];
NSString *callerName = [payload.dictionaryPayload valueForKeyPath:@"custom.a.ani"];
NSString *status = [payload.dictionaryPayload valueForKeyPath:@"custom.a.status"];
if(status == nil || status.length < 1){
[RNCallKeep reportNewIncomingCall:uuid handle:@"generic" handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit: YES];
completion();
} // Else we let the CallKeep event listeners pick this up and process the status update
} |
To be very clear, the only thing you can use VoIP PushKit notifications for now is incoming call INVITES. The documentation is here:
and
This sucks, as it implies Apple's thoughts are the only valuable ones, but it's the way you have to do it if you want to continue operating within the Apple ecosystem. Using VoIP for CANCEL will mostly work, but you end up with a race condition where your app can be killed for not reporting an incoming call during the PushKit callback. |
Ah yes I was getting confused which way around the relationship was. I actually just experienced killing of apps myself as some code I'd written wasn't able to call callkit and so my app got punished. no pushkit token given when asked for etc. Thanks @kylekurz So long and short. VoIP Pushkit for starting a call and that's it. |
@danjenkins @r0b0t3d @kylekurz yes seems like you are all correct, after a few tests my app no longer receives the "silent" VoIP Push. I switched over to using regular silent push, but I am seeing some odd behavior: silent pushes without content or title are being ignored completely while the CallKit Incoming Call UI is present. Note, silent pushes work fine if I provide a content/title OR the CallKit Incoming Call UI is not present. Do you think Apple has prohibited silent push in this scenario? UPDATEFor some reason the |
With ios 13, apple has changed the flow we handle voip incoming push notification.
pushRegistry(_:didReceiveIncomingPushWith:for:completion:)
I added new class method to report incoming call when there is new voip push