-
Notifications
You must be signed in to change notification settings - Fork 48
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
Hot to handle Reject Event #23
Comments
You have to fork and edit this package yourself.. In android i saw reject call button Intent being sent to a Broadcast Receiver, not to main activity. So my solution on android is registering headless js task in index.android.js. and from Broadcast receiver in react-native-voip-call. I start a Headless service, everytime reject call is pressed. it will send to js side (in background without open the app), from there i can do task like update db, send reject event... |
Can you please show some code so that can get idea for implementing your solution. Thanks |
You can check my fork: master...hoangtu92:react-native-voip-call:master And here is my JS headless ` export const lds_bg = async (taskData) => {
}; ` |
Thanks for the reply. can you please tell where i need to put this code in
index.js right?
…On Thu, Mar 23, 2023 at 9:49 AM hoangtu92 ***@***.***> wrote:
You can check my fork: master...hoangtu92:react-native-voip-call:master
<master...hoangtu92:react-native-voip-call:master>
And here is my JS headless `export const lds_bg = async (taskData) => {
// any background logic here
// .....
console.log("Task data", taskData)
switch(taskData.action){
case "callDismiss":
console.log('End call headless', taskData);
RNVoipCall.endAllCalls();
RNVoipCall.stopRingtune();
DeviceEventEmitter.emit("lds.end_call", taskData);
break;
default:
RNVoipCall.getInitialNotificationActions().then(data=>{
console.log("getInitialNotificationActions", data);
switch(data.action){
case "fullScreenIntent":
case "contentTap":
RNVoipCall.endAllCalls();
navigate("Modal", {screen: "IncomingCallScreen", params: data})
break;
case "callAnswer":
DeviceEventEmitter.emit("lds.accept_call", data);
navigate('Modal', {
screen: 'VideoCall',
params: {headLess: false, isVideo: false, remote_user_uid: data.callerId},
});
break;
case "missedCallTape":
break;
}
}).catch(e=>console.log(e));
break;
}
};
`
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A22AVDTPCI5RHQQRYZESSZTW5PFO7ANCNFSM4XNHW6EA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Yes. Although I placed it in index.android.js because this code I use only for android. |
You can export above module and then call this |
Thanks, I'll check it out.
…On Thu, Mar 23, 2023 at 10:48 AM hoangtu92 ***@***.***> wrote:
You can export above module and then call this AppRegistry.registerHeadlessTask("lds_bg",
() => lds_bg);
—
Reply to this email directly, view it on GitHub
<#23 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A22AVDQL4BAJLGYRY2RRR23W5PMKZANCNFSM4XNHW6EA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hey ,
I need your help in this package like in android 12 when receiving a call
it just rings only and doesn't show a notification banner with two buttons
'answer' and 'decline'. So can you please let me know what changes I need
to make in this package.
Thanks
On Thu, Mar 23, 2023 at 12:57 PM Karan Singh ***@***.***>
wrote:
… Thanks, I'll check it out.
On Thu, Mar 23, 2023 at 10:48 AM hoangtu92 ***@***.***>
wrote:
> You can export above module and then call this AppRegistry.registerHeadlessTask("lds_bg",
> () => lds_bg);
>
> —
> Reply to this email directly, view it on GitHub
> <#23 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A22AVDQL4BAJLGYRY2RRR23W5PMKZANCNFSM4XNHW6EA>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
You can test it out with a simple code that show a simple notification first. Also It's worth to check whether the phone is in silent/power saving mode or not. |
Use react-native-voips-calls, which have android 12+ support |
I have a little issue, I want to do an API call to update the call status in DB if the user rejects the call.
Is there any listener or workaround to perform this action?
Thanks
The text was updated successfully, but these errors were encountered: