Skip to content
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 incoming call/push notification doesn't work #462

Open
3 tasks done
ViktorSyrotkin opened this issue Dec 19, 2024 · 11 comments
Open
3 tasks done

Android incoming call/push notification doesn't work #462

ViktorSyrotkin opened this issue Dec 19, 2024 · 11 comments

Comments

@ViktorSyrotkin
Copy link

No events or notifications were triggered for incoming calls on Android.

Pre-submission Checklist

  • I have verified that the issue occurs with the latest release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Description

I am not able to receive an incoming call event. I am not able to receive incoming call push notification. Firebase handlers not firing for twilio incoming call pushes but works for app pushes. I am using the flag for disabling twilio notification service. Tested on v1.2.1 and v1.3.0 – no result.

Everything is setup in twiml console.
Device is registered successfully with the same token that I get from Firebase. ( I can see it from the logs in logcat).
It was also confirmed that the call is starting and we are dealing to this user on the backend and it looks normal - like nobody answered.

Reproduction Steps

1.Completed all steps as described in the Twilio Voice React Native SDK documentation.
2.Set up a Firebase project and linked it for FCM.
3.Followed instructions for Twilio Push for FCM HTTP v1 API.
4.Updating-Twilio-Push-for-FCM-HTTP-v1-API.
5.Registered for incoming calls using the Twilio SDK with:
voice.on(Voice.Event.Registered, () => {
console.log('Successfully registered for incoming calls');
});
5.No further events or notifications were triggered for incoming calls.

Expected Behavior

Expect to receive push and incoming call event as it is on ios.

Actual Behavior

I am not able to receive an incoming call event. I am not able to receive incoming call push notification.

Reproduction Frequency

Constantly reproducing

Screenshots

This is what I see in the logcat when I start the call and then drop it.
photo_2024-12-19 18 47 26

Software and Device Information

  • Device: [Samsung SM-346B1]
  • OS: [Android 14, API Level 34]
  • React version: [18.2.0]
  • React Native version: [0.72.6]
  • Node version: [20.12.1]
  • yarn version: [1.22.22]
@mhuynh5757
Copy link
Collaborator

Hi @ViktorSyrotkin thanks for the thorough details with your issue report, it helps us tremendously with debugging your issue. Do you see any logs in your logcat about an FCM token? The line should read something like "Refreshed FCM token: ..."

@mhuynh5757
Copy link
Collaborator

You also mentioned that you disabled the built in Firebase messaging service, what 3rd party Firebase messaging service are you using? And how are you using the voice.handleMessage API? Is it possible to provide a code snippet for how you're using voice.handleMessage?

@ViktorSyrotkin
Copy link
Author

ViktorSyrotkin commented Dec 20, 2024

Hey @mhuynh5757 Thanks for quick response!

  1. I have "Registering with FCM with token" and "Successfully registered FCM". Nothing about Refreshed fcm token...
  2. I use @react-native-firebase/messaging and @react-native-firebase/firestore. I added it to the messaging().onMessage(async (remoteMessage: FirebaseMessagingTypes.RemoteMessage) => { handler just as it is in the docs. It is simply not firing when I make a call. But it does work for usual notifications. I also use "@notifee/react-native": "^7.8.2", in my project.

@mhuynh5757
Copy link
Collaborator

You'll have to disable the build in Firebase messaging service that we include in our library. You can find out more about it here: https://github.com/twilio/twilio-voice-react-native/blob/main/docs/out-of-band-firebase-messaging-service.md

@mhuynh5757
Copy link
Collaborator

Also, you can force refresh the FCM token by uninstalling the app and reinstalling it on your device. This might help if the FCM token is out-of-date or expired.

@ViktorSyrotkin
Copy link
Author

@mhuynh5757 I did it just after installed version 1.2.1. Unfortunately , didn't help

@ViktorSyrotkin
Copy link
Author

@mhuynh5757 did token force update too. I can see it changing in the console. Tokens are different each time I reinstall the app.

@ViktorSyrotkin
Copy link
Author

I have read all the issues and all the docs on this sdk. I saw you recommending all this steps to other developers in similar issues.

@mhuynh5757
Copy link
Collaborator

Hey @ViktorSyrotkin can we do a test to see if your credentials are set up properly? Can you try to make an incoming call using our test app that's built into the repo under test/app/? That way we can tell if it's the two Firebase messaging services (one from our library and one from the RNFirebase) that might be clashing.

@ViktorSyrotkin
Copy link
Author

@mhuynh5757 Hey. Thanks for the response! I have tested the test/app/ and it behaves exactly like my own app does.
I placed google services json to test/app/android/app and used token for voice.register() which was generated on our back-end. I am able to make calls but not able to receive them.
As I understand correctly , there is some issue with my credentials are not set up properly...
WDYT?

@mhuynh5757
Copy link
Collaborator

@ViktorSyrotkin yeah that would appear to be the case since I am able to make outgoing calls and receive incoming calls with the test app. Have you figured out your credential issue or are you still having trouble?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants