Closed jackywxd closed 2 years ago
Hey how did you fix this ?
@vjhameed I used patch-package to patch it without updating the original npm package. Below is the patch file:
static callKeepOptions: IOptions
private static fetchAccessToken: () => Promise
RNTwilioPhone.callKeepOptions = callKeepOptions; const unsubscribeCallKeep = RNTwilioPhone.initializeCallKeep( callKeepOptions, fetchAccessToken, @@ -79,7 +80,7 @@ class RNTwilioPhone { }) .catch((e) => console.log(e)); } else {
RNCallKeep.registerPhoneAccount();
RNCallKeep.registerPhoneAccount(callKeepOptions); RNCallKeep.registerAndroidEvents(); RNCallKeep.setAvailable(true); } @@ -103,7 +104,7 @@ class RNTwilioPhone { return; }
RNCallKeep.registerPhoneAccount();
RNCallKeep.registerPhoneAccount(RNTwilioPhone.callKeepOptions); RNCallKeep.registerAndroidEvents(); RNCallKeep.setAvailable(true);
Hi, thank you for reporting that issue. Could you submit a PR?
@MrHertal Sure will do.
@jackywxd could you also drop the fcm payload example ? i keep getting the invalid twillio voice sdk payload error.
Thanks man
@vjhameed If you are getting invalid twilio voice sdk payload error, that's different issue. You probably should revisit your project configurations following the twilio voice sdk documentations.
I don't have fcm payload example for this case.
Good luck!
I did go through the documentation a thousand times. The use case on my end is that i want to receive calls on the react antive app. But when twillio hits the backend webhook i don't know what payload to send in the push notification to the react native app
I think you have misconception of the whole workflow. what Twilio expects from webhook is TwiML response. After that VOIP push notification is handled by Twilio, not by webhook. There are more details in Twilio's documentation about how to setup VOIP certificates.
Good luck!
@jackywxd can you please do me a favor and explain the worflow in steps. would really help alot.
Thanks a thousand times dude
@jackywxd can you please help mate
@vjhameed I don't think I can do a better job than Twilio. As I said Twilio has done a pretty good job in terms of documentation. If it doesn't make sense for you, nor can I make it clear.
@MrHertal @vjhameed @jackywxd that fix alone isn't enough for when the app is killed, check https://github.com/MrHertal/react-native-twilio-phone/pull/76#issuecomment-1051023132
have same problem, waiting for PR #76
I have released https://github.com/MrHertal/react-native-twilio-phone/releases/tag/v1.9.0 which contain a fix for that issue. Thanks!
Thanks for your efforts to create such wonderful package! It saved me days for one of my projects.
In methods: initializeCallKeep and handleBackgroundState, RNCallKeep.registerPhoneAccount() is called without passing the required callKeepOptions. This will prevent the CallKeep from handling incoming calls in background, and will get error:
[TypeError: Cannot read properties of undefined (reading 'android')]
Because callKeepOptions was missing (undefined).
A simple solution is to add: static callKeepOptions: IOptions
to save the callKeepOptions in initialize(), and pass it to RNCallKeep.registerPhoneAccount.
Hope this can help and thanks again!