I've been stuck on this for quite some time. I am using Sinch to establish calls.
This is the case:
User A --calls--> User B
User B <--receives call -- User A
User B receives the call.
User A --calls--> User B
User B <--receives call notification-- User A
User B --opens--> Call Activity -> but there is no incoming call
Caller's Code:
if (this.mCall == null) {
mStatusInfo.setText("Calling...");
this.mCall = this.mSinchClient.getCallClient().callUser(mRecipientId);
this.mCall.addCallListener(new SinchCallListener());
//Test
String callId = this.mCall.getCallId();
this.sendNotification(mTalkPath,mAuthor,mRecipient, callId);
}
Receivers' Code:
private class SinchCallClientListener implements CallClientListener {
@Override
public void onIncomingCall(CallClient callClient, Call incomingCall) {
//Pick up the mCall!
mStatusInfo.setText("Incoming call...");
mCall = incomingCall;
mCall.addCallListener(new SinchCallListener());
String metaData = String.format("%s, %s", mRecipient.getGender(), mRecipient.getBirthDate());
mInfoText.setText(metaData);
}
}
Is there any way to receive the call by using FCM? Maybe the callId can be a key to solve this?
Check out this https://www.sinch.com/docs/voice/android/#pushnotificationssentviayourapplicationserver
That should give you the solution you need