Closed amritashan closed 4 months ago
I changed the method VoiceFirebaseMessagingService.handleInvite()
to add a sendBroadcast()
and it works now:
private void handleInvite(CallInvite callInvite, int notificationId) {
Intent intent = new Intent(this, IncomingCallNotificationService.class);
intent.setAction(Constants.ACTION_INCOMING_CALL);
intent.putExtra(Constants.INCOMING_CALL_NOTIFICATION_ID, notificationId);
intent.putExtra(Constants.INCOMING_CALL_INVITE, callInvite);
startService(intent);
Log.d(TAG, "Sending broadcast for incoming call");
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
}
However, that raises more questions for me (sorry I am a newbie)
Why does handleCanceledCallInvite()
not require a similar sendBroadcast()
call and yet the ACTION_CANCEL_CALL
intent is received in the VoiceBroadcastReceiver
, but the ACTION_INCOMING_CALL
is not without the broadcast?
Is some other part of the code supposed to send a broadcast for the incoming call?
If this fix is right, i would be happy to send a pull request, but this solution is confusing.
After a little more research, I made a few more changes:
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
need not be called in VoiceFirebaseMessagingService
.startService(intent)
already sends the intent to IncomingCallNotificationService
, the broadcast needs to be done from IncomingCallNotificationService.handleIncomingCall()
So, here are the changes, I would do:
VoiceFirebaseMessagingService.handleInvite()
sendBroadcast()
callIncomingCallNotificationService.onStartCommand()
case Constants.ACTION_INCOMING_CALL:
handleIncomingCall(intent);
break;
IncomingCallNotificationService.handleIncomingCall()
private void handleIncomingCall(Intent intent) {
CallInvite incomingCallInvite = intent.getParcelableExtra(Constants.INCOMING_CALL_INVITE);
int notificationId = intent.getIntExtra(Constants.INCOMING_CALL_NOTIFICATION_ID, 0);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setCallInProgressNotification(incomingCallInvite, notificationId);
}
Log.d(TAG, "Sending broadcast for incoming call");
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
}
amritashan Thank you for filing this and discovering the issue. We have reported it with our team and it will be getting looked into.
@amritashan We've merged the fix now incoming call dialog should show as expected.
Description
The voice-android-quickstart app does not show an incoming call dialog.
Steps to Reproduce
VoiceActivity.java
google-services.json
file in the app root.Expected Behavior
You should receive:
Actual Behavior
Only a push notification is received
Reproduces How Often
100%
Versions
All relevant version information for the issue.
Voice Android SDK
6.5.0
OS Version
Android 14
Device Model
Pixel 3a, Pixel 8 Pro