I was able to integrate Twilio Video API and audio calling is working as a web app. However, when I try to build it for mobile via Phonegap Build, the audio calling is not working as expected. There were no errors reported via Chrome Dev Tools USB debugging method.
Works:
- Web to Web calling Web to mobile app (I can hear the call the clearly, from either end)
Not working:
- Mobile to web (No sound at all, I can only hear the voice of the one calling via web)
- Mobile to mobile (Nothing at all)
At first, Twilio Video API is not working in Phonegap app and returning undefined
on twilio-conversations.min.js
. I was able to fix that by adding Crosswalk <plugin name="cordova-plugin-crosswalk-webview" spec="~2.1.0" source="npm" />
as I suspect it has something to do with webrtc. After adding this plugin, the Twilio can now create conversation and connect both participants.
I can't figure out what to do next. I tried adding cordova-plugin-media-capture
to capture sound and activate "record audio permission", but still no luck.
Maybe I'm missing something. Any suggestion is very much appreciated. :)
Here's my Phonegap config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.app.experiment"
versionCode = "1"
version = "1.0.0">
<name>Twilio Phonegap Experiment</name>
<description>
Twilio Phonegap Testing
</description>
<author href="https://domainhere.com" email="woppi@domainhere.com">
woppi
</author>
<platform name="android"/>
<preference name="phonegap-version" value="cli-6.3.0" />
<preference name="orientation" value="portrait" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="disallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="21" />
<preference name="android-installLocation" value="auto" />
<platform name="android">
<icon src="res/icon/android/drawable-ldpi-icon" qualifier="ldpi"/>
<icon src="res/icon/android/drawable-mdpi-icon" qualifier="mdpi"/>
<icon src="res/icon/android/drawable-hdpi-icon" qualifier="hdpi"/>
<icon src="res/icon/android/drawable-xhdpi-icon" qualifier="xhdpi"/>
<icon src="res/icon/android/drawable-xxhdpi-icon" qualifier="xxhdpi"/>
<icon src="res/icon/android/drawable-xxxhdpi-icon" qualifier="xxxhdpi"/>
</platform>
<platform name="android">
<splash src="res/screen/android/drawable-port-ldpi-screen" qualifier="ldpi"/>
<splash src="res/screen/android/drawable-port-mdpi-screen" qualifier="mdpi"/>
<splash src="res/screen/android/drawable-port-hdpi-screen" qualifier="hdpi"/>
<splash src="res/screen/android/drawable-port-xhdpi-screen" qualifier="xhdpi"/>
<splash src="res/screen/android/drawable-port-xxhdpi-screen" qualifier="xxhdpi"/>
<splash src="res/screen/android/drawable-port-xxxhdpi-screen" qualifier="xxxhdpi"/>
</platform>
<preference name="permissions" value="none"/>
<plugin name="cordova-plugin-camera" spec="~2.1.1" source="npm"/>
<plugin name="cordova-plugin-device" spec="~1.1.1" source="npm"/>
<plugin name="cordova-plugin-dialogs" spec="~1.2.0" source="npm"/>
<plugin name="cordova-plugin-geolocation" spec="~2.1.0" source="npm"/>
<plugin name="cordova-plugin-inappbrowser" spec="~1.3.0" source="npm"/>
<plugin name="cordova-plugin-network-information" spec="1.2.0" source="npm"/>
<plugin name="cordova-plugin-splashscreen" spec="~3.2.1" source="npm"/>
<plugin name="cordova-plugin-statusbar" spec="~2.1.2" source="npm"/>
<plugin name="cordova-plugin-whitelist" spec="~1.2.1" source="npm"/>
<plugin name="cordova-plugin-crosswalk-webview" spec="~2.1.0" source="npm" />
<plugin name="cordova-plugin-media-capture" spec="~1.4.0" source="npm" />
<access origin="*" subdomains="true"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
</platform>
</widget>