-
Notifications
You must be signed in to change notification settings - Fork 34
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
Android: Why is the event called callInviteEventTypeValueCallInviteNotificationTapped #473
Comments
Hi @jhutchins it's a long-winded name haha, I can understand the potential for confusion. The event is supposed to fire when you have the app backgrounded or foregrounded (not closed) and you tap on the body of the notification of the incoming call. It should also be somewhat obfuscated, that whole Are you seeing the raw string somewhere in a public API? That would be indicative of a bug somewhere in our event handling and we can attempt to investigate. |
In the public api it's called |
Can you describe the exact steps you're performing to reproduce this issue? For what it's worth, I just did the following and analyzed the Android logcat:
I did not observe within the Android logcat the intent that you're referring to being fired. |
It appears we may be talking past each other, so please give me one more attempt to explain. My thesis is that the event name This is easily evidenced by interacting with the sample application. If you look at this code from the sample application that you wrote /**
* Handle the call invite notification tapped event.
*/
const handleCallInviteNotificationTapped = () => {
navigate('Incoming Call');
};
callInvite.on(
TwilioCallInvite.Event.NotificationTapped,
handleCallInviteNotificationTapped,
); You can see that on the If you read the Android code from this repository you will see that the only place that event is fired is in this method private void foregroundAndDeprioritizeIncomingCallNotification(final CallRecordDatabase.CallRecord callRecord) {
logger.debug("foregroundAndDeprioritizeIncomingCallNotification: " + callRecord.getUuid());
// cancel existing notification & put up in call
Notification notification = NotificationUtility.createIncomingCallNotification(
VoiceService.this,
callRecord,
VOICE_CHANNEL_DEFAULT_IMPORTANCE);
createOrReplaceNotification(callRecord.getNotificationId(), notification);
// notify JS layer
sendJSEvent(
ScopeCallInvite,
constructJSMap(
new Pair<>(CallInviteEventKeyType, CallInviteEventTypeValueNotificationTapped),
new Pair<>(CallInviteEventKeyCallSid, callRecord.getCallSid())));
} That method is invoked from only one place in the library case ACTION_FOREGROUND_AND_DEPRIORITIZE_INCOMING_CALL_NOTIFICATION:
foregroundAndDeprioritizeIncomingCallNotification(
getCallRecord(Objects.requireNonNull(getMessageUUID(intent))));
break; which is executed when the |
Hi @jhutchins apologies for any miscommunication on my part. Let's see if we can sort this out together. The
Another scenario I've tested:
What I also see is that that Perhaps it's important to note that this event is intended to fire when tapping on the body of the notification, not an action button such as "Accept" or "Reject". |
One such use-case for this event, where a user taps on the body of the notification instead of either rejecting or accepting it from the notification, is so that you can update your UI in the React Native app to show a fullscreen incoming call. This way you can display extra info about the incoming call, for example "Nickname" or "Mutual friends" etc. You can see how we create a fullscreen incoming call in our Reference App and how we use it there: https://github.com/twilio/twilio-voice-react-native-app/blob/main/app/src/store/bootstrap.ts#L179 |
In one of your messages, you observe that the intent that fires this event occurs when you lock the screen and receive an incoming call, I am assuming that you are not tapping the content body of the incoming call notification. This indeed would be a bug, I would like to ask you to confirm if this is the issue that you're trying to report? I would also like to confirm that I tested this on my end and I'm not seeing the event fire or the intent being constructed. If this is the case, can you provide more details on your development environment? If you could fill out the issue template and include all the relevant version info, it may provide insight into this problem. For example, I'm testing with latest Android API 35 on a virtual Pixel 9, you may be seeing different things because you're on a different setup, i.e. a real device or an older API. |
@mhuynh5757 thanks for the work you have done on this. can you confirm that if you kill the app and then lock, you are still able to receive incoming call okay? So these steps...
|
@mhuynh5757 are you saying that when you lock the screen and receive a call it doesn't call the |
@dwbelliston let me give that a shot, I'll get back to you when I have some results to share. @jhutchins that's correct, when I lock the screen and receive a call, I do not see the |
@mhuynh5757 I'm using a physical Pixel 7 running Android 15 (aka Vanilla Ice Cream). |
I don't understand why the event
callInviteEventTypeValueCallInviteNotificationTapped
is called this.As best I can tell, this event is only ever triggered from Android and is done unconditionally whenever a call comes in while the phone is locked. This has nothing to do with the notification being tapped in the sense of physical interaction. I suppose that it could make sense that you've tapped into the incoming call invite, but it's a confusing name.
The text was updated successfully, but these errors were encountered: