Closed dmitriy-uvin closed 7 months ago
Hello @dmitriy-uvin I'm going to link this issue here, I am assuming it is the same issue, please let me know if that is not the case.
https://github.com/twilio/twilio-voice-react-native-app/issues/136
I am also going to close the issue on the other repository.
I suspect that your issue could be caused by Expo. We unfortunately do not support Expo, we have not tested our library in that environment and it is unfortunately not in our roadmap at this time. Could you please try running the Reference App on your device to see if you encounter the same issue?
Hi @mhuynh5757. The reference app with struggles but working, but it's really hard to implement it in the new RN app that uses Kotlin instead of Java without proper documentation. What about iOS platform, is it ready-to-go for ios? How it can be handled?
Here is the link to my startup app - https://github.com/dmitriy-uvin/mobile-dialpad. And issue that extremely blocks me - https://github.com/twilio/twilio-voice-react-native/issues/298.
Hi @dmitriy-uvin yes the library and reference app are both iOS ready. I have responded to your other issue, please refer to my comment there. I will discuss with the team regarding Kotlin.
@mhuynh5757 Responded in other issues, thank you. If you can it would be better to discuss creating better documentation (part that is related to android & ios folders). Kotlin is pretty similar to Java, so it's easy to convert Java code to Kotlin (at least for now).
@dmitriy-uvin Library works fine on both Android and iOS with Expo EAS. Just needs some manual changes for incoming calls in Android, but outgoing works well.
@shridhar-toptal where can I find what changes needs to be done in order to enable it in expo?
@dmitriy-uvin Here is the plugin I created for Expo
const { withPlugins, withAndroidManifest } = require("@expo/config-plugins");
function withTwilioAndroidFix(config) {
return withAndroidManifest(config, (mod) => {
mod.modResults.manifest.application[0].service = [
...(mod.modResults.manifest.application[0].service ?? []),
{
$: {
"android:name":
"com.twiliovoicereactnative.VoiceFirebaseMessagingService",
"android:stopWithTask": "false",
"android:exported": "true",
},
"intent-filter": [
{
action: [
{
$: {
"android:name": "com.google.firebase.MESSAGING_EVENT",
},
},
],
},
],
},
{
$: {
"android:enabled": "true",
"android:name":
"com.twiliovoicereactnative.IncomingCallNotificationService",
"android:foregroundServiceType": "microphone",
"android:exported": "true",
},
"intent-filter": [
{
action: [{ $: { "android:name": "ACTION_ACCEPT" } }],
},
{
action: [{ $: { "android:name": "ACTION_REJECT" } }],
},
],
},
];
mod.modResults.manifest.application[0].activity = [
...(mod.modResults.manifest.application[0].activity ?? []),
{
$: {
"android:name":
"com.twiliovoicereactnative.NotificationProxyActivity",
"android:parentActivityName": ".VoiceActivity",
"android:noHistory": "true",
"android:excludeFromRecents": "true",
"android:taskAffinity": "",
"android:launchMode": "singleTask",
"android:theme": "@android:style/Theme.Translucent.NoTitleBar",
"android:exported": "true",
},
},
];
return mod;
});
}
module.exports = function (config) {
return withPlugins(config, [withTwilioAndroidFix]);
};
@shridhar-toptal do you have any documentation link for it?
Issue
Pre-submission Checklist
Description
I need to implement the ability to make and receive calls from my React Native app. I use React Native in conjunction with Expo. I used https://github.com/twilio/twilio-voice-react-native-app as an example, but it for raw react-native app, not Expo. When I am trying to init the call from my RN app I receive an error described below.
Expected Behavior
Instead of error I need to start the call with callee.
Actual Behavior
Instead of creating call and calling to callee - error.
Reproduction Frequency
Try to connect to the call in Expo React Native project.
Software and Device Information
Please complete the following information.
Additional Context
I need to implement ability to make and receive calls from my React Native app. I use React Native in conjunction with Expo. Here is my package.json
Here is my API that is responsible for generating Access Token with Voice grant:
Here is my method that is responsible for TwilML that is used in TwilML app:
React native component that triggers call:
Important note: event voice.on are not triggered at all.
I receive next error during call init:
ANY IDEAS how it can be solved?