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

Ios issue app is in kill state and pick up the call from notification then app freeze react-native #455

Open
asadumair opened this issue Nov 26, 2024 · 12 comments
Labels
needs more info Needs more info from the issue author.

Comments

@asadumair
Copy link

The issue we are facing in ios side like when we receive the call in foreground or background it is working fine but when we receive the call from notification and app is then app will be open but look like freeze no events are fired in twilio-voice-react-native SDK.
Basically in normal firebase notifications when app is in kill state and we click on notification then our app is open and firebase is initialize automatically but for this case our app is freeze so please help us

@imuhammadnadeem
Copy link

I'm encountering the same issue where, after the call popup appears and I click on 'Accept,' the call gets accepted successfully, but no event is triggered in my code. Also, I'm getting 52134 Error in Twilio console logs.

@tamdvyounetgroup
Copy link

Where the issues is on? Android or IOS ?

@AsadUmair94
Copy link

Where the issues is on? Android or IOS ?

issue is in ios

@mhuynh5757
Copy link
Collaborator

Hello all, could you please provide some more information, like iOS device and iOS version? Thanks! This is an interesting issue since I've tested this personally, there may be some app logic that could be causing this.

@mhuynh5757 mhuynh5757 added the needs more info Needs more info from the issue author. label Dec 3, 2024
@AsadUmair94
Copy link

we are tested on multiple devices ios 18.1.1 iphone 14 pro, ios 17.6.1 iphone 11, ios 17.6.1 iphone 12 pro max all devices has the same issue

@AsadUmair94
Copy link

Hello all, could you please provide some more information, like iOS device and iOS version? Thanks! This is an interesting issue since I've tested this personally, there may be some app logic that could be causing this.

if there is issue in logic it should not work in foreground mode or background mode it is only causing issue when app is in kill state. when we pick up the call in kill state the call gets accepted successfully, but no event is triggered in my code.

@asadumair
Copy link
Author

please response to our issue our clients are suffered

@mhuynh5757
Copy link
Collaborator

Can you provide any Xcode debug logs? If the app is freezing or crashing, there may be a stack trace we can follow in the native logs.

@imuhammadnadeem
Copy link

Can you provide any Xcode debug logs? If the app is freezing or crashing, there may be a stack trace we can follow in the native logs.

The app is not freezing or crashing. I can receive calls when the application is in the foreground, background, or killed state. However, the issue arises specifically in the killed state:

  • In the foreground and background, my logic for handling callInvites works as expected, and the function for processing callInvites and showing the UI is called correctly.
  • In the killed state, I can accept and talk on the call, but the function I wrote to handle callInvites and display the UI is not triggered.

Let me know if additional details or logs would help clarify further.

@mhuynh5757
Copy link
Collaborator

I believe I understand your use case now. You will need to check for existing call invites upon a fresh launch of your app. You can check how I do that in our reference app or our test app:

Reference app: https://github.com/twilio/twilio-voice-react-native-app
Test app: https://github.com/twilio/twilio-voice-react-native/tree/main/test/app

Specifically, what you want to do is voice.getCallInvites early in your application as a "bootstrap" method. Then, when the app is freshly launched out of kill state, you know whether or not to handle call invites. It has to be done this way because while the app is killed, we cannot send events to the JS layer from the native layer.

Hope that helps! Please let me know if you need further assistance.

@imuhammadnadeem
Copy link

Thank you for the guidance! I believe I’ve implemented this correctly, but I’m still facing some issues.

I have these two functions in the library:

1- getCalls() - Gets a list of existing calls, ongoing and pending.
2- getCallInvites() - Gets a list of pending call invites only.

Here’s my code for getting calls and call invites:

import { Voice } from '@twilio/voice-react-native-sdk';

const voice = new Voice();

export const getCallsFromTwilio = async () => {
try {
return await voice.getCalls();
} catch (error) {
console.log(error);
}
};

export const getCallInvites = async () => {
try {
return await voice.getCallInvites();
} catch (error) {
console.log(error);
}
};

// Usage
const token = '';
await voice.register(token);

const callInvites = await getCallInvites();
const twilioCalls = await getCallsFromTwilio();

console.log("Call Invites:", callInvites);
console.log("Twilio Calls:", twilioCalls);

I am calling these functions after registering the device (voice.register(token)), but I’m not getting any data in callInvites or twilioCalls.

It couldn’t be in callInvites because the call is already settled, but I expected it to show up in twilioCalls.

Can you guide me on what might be missing in my implementation or if there's something wrong with the flow?

@asadumair
Copy link
Author

Thank you for the guidance! I believe I’ve implemented this correctly, but I’m still facing some issues.

I have these two functions in the library:

1- getCalls() - Gets a list of existing calls, ongoing and pending. 2- getCallInvites() - Gets a list of pending call invites only.

Here’s my code for getting calls and call invites:

import { Voice } from '@twilio/voice-react-native-sdk';

const voice = new Voice();

export const getCallsFromTwilio = async () => { try { return await voice.getCalls(); } catch (error) { console.log(error); } };

export const getCallInvites = async () => { try { return await voice.getCallInvites(); } catch (error) { console.log(error); } };

// Usage const token = ''; await voice.register(token);

const callInvites = await getCallInvites(); const twilioCalls = await getCallsFromTwilio();

console.log("Call Invites:", callInvites); console.log("Twilio Calls:", twilioCalls);

I am calling these functions after registering the device (voice.register(token)), but I’m not getting any data in callInvites or twilioCalls.

It couldn’t be in callInvites because the call is already settled, but I expected it to show up in twilioCalls.

Can you guide me on what might be missing in my implementation or if there's something wrong with the flow?

i had also did the same implementation and there is same issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Needs more info from the issue author.
Projects
None yet
Development

No branches or pull requests

5 participants