[Sandbox] Using WebRTC on Android
I'm having problem with implementing webRTC SDK on my Android app. I have tried the sample webRTC app, and yes, the attempt to use the call didn't fail at all, but the contacts didn't appear after signing in sometimes.
Back to the main problem, I had studied the code from the sample app and I had tried to follow the steps into implementing it into my app:
1. RainbowSdk was successfully initialised on the class extending Application. Also confirmed that I already used the app on my Manifest.
2. Connection successfully established. I established the connection on my MainActivity on my onCreate method. My application launcher activity was another Splash Screen activity, which checks for existing Firebase user, then if the user exists, MainActivity would launch.
3. Then I created another Activity to test out the Sign In Process, Contact Listener, and webRTC module. The activity implements Contact.ContactListener and ITelephonyListener. I also copied the whole code of WebRTCActivity from the sample app.
4. On that Activity, I tried to sign in using a test account, and successfully signed.
5. On my sign in method, I added a SigninResponseListener which then registers IItemListChangeListener and TelephonyListener like this (my Activity name was VoiceCallActivity and I declared the contact listener as a field of the Activity):
RainbowSdk.instance().contacts().getRainbowContacts().registerChangeListener(contactItemListener);
RainbowSdk.instance().webRTC().registerTelephonyListener(VoiceCallActivity.this);
6. After I successfully signed in, the contacts were retrieved and displayed properly. I also stored the contacts I got from
RainbowSdk.instance().contacts().getRainbowContacts().getCopyOfDataList();
into a List<IRainbowContact> I prepared as a field on VoiceCallActivity.
7. Then I attempted to make a voice call (I ran it on an emulator and also installed the app on one real device, and of course I also tried the sample app with this setup) using the contact from the List<IRainbowContact> I created previously. I had confirmed that both devices are connected and signed in properly since the debugger detected my device sign in process. For example:
[MARK: Call Attempted/Call Received Debug Log]
I/System.out: verbo : [XmppContactMgr]: >presenceChanged; <presence to='7b2b941925214f9b9b28bcd42a2a0e68@sandbox-all-in-one-prod-1.opentouch.cloud/mobile_android_sdk_020000000000' from='0bf1ea8af489422c9a5842ee05109d88@sandbox-all-in-one-prod-1.opentouch.cloud/mobile_android_sdk_020000000000' id='e4b4p-14' xml:lang='en'><status></status><priority>5</priority><parameters xmlns='jabber:iq:configuration'><presence></presence></parameters><application xmlns='jabber:iq:application'><userid>5b69757d9551fc10dc863ea7</userid></application><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.igniterealtime.org/projects/smack' ver='sOmbM0BsqmsCT280bdcNaLbpCu8='/></presence>
I/System.out: verbo : [XmppContactMgr]: >>>> OTHER PRESENCE RECEIVED ; NS
I/System.out: verbo : [DirectoryContact]: >setPresence=online
verbo : [DirectoryContact]: >updatePresence
I/System.out: verbo : [ContactCacheMgr]: >onPresenceChanged
then when the call was made, the debugger showed me this:
[MARK: Call Ended Log]
I/System.out: verbo : [XmppContactMgr]: >>>> OTHER PRESENCE RECEIVED ; NS
I/System.out: verbo : [DirectoryContact]: >setPresence=busy_audio
verbo : [DirectoryContact]: >updatePresence
I/System.out: verbo : [DirectoryContact]: presence available found...for contact : NS
which means that the call attempt actually found the contact, and making the call. And the copied WebRTCActivity also showed up with Outgoing Call layout, but the target device didn't ring. I canceled the call, and another debug log similar to the one above showed up telling me that the presence had been set back to online.
8. Then I attempted a vice versa test, where I made the call using the device towards the emulator, and yes, the debug message with the same content as the one I marked as "Call Attempted/Call Received Debug Log" also showed up, on the debugger, still attached to the emulator, which means that the call was somehow detected, but the implemented onCallAdded method wasn't called.
I would like to get some clarifications about where did I do it wrong. Did I miss certain steps? Or are there some sort of conflicts caused by certain dependencies?
-
Official comment
Hello,
For the moment the SDK methods of ITelephonyListener (onCallAdded...) are only triggered if you have both audio and video autorisations. So additionnaly to the permissions listed in your manifest, you have to ask runtime permissions for audio and video before you can recieve calls.
Comment actions -
I also forgot to mention that I already included these permissions and added permission requesting methods only for microphone/audio recording since I only wanted to use Voice Call feature only. I already followed the requirements mentioned on the SDK Guide.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<uses-permission android:name="MODIFY_AUDIO_SETTINGS"/> -
This issue still happens. I am not a poster of this comment, but as an Android developer, this issue is really here. Github WebRTC Android sample app: It is never being worked for incoming call. Only outgoing call layout is being appeared, but incoming call is never working (from the caller in both of web and mobile)
-
Hi Pascal BORSCHNECK ,
I'm still facing the same issue, Notification and Web-RTC calls are not triggered when android application killed.
Could you please help me out?
Best Regards,
Vamsi K
Wilco Source LLC.
-
Hi Vamsi,
Have you implemented PUSH ?
https://hub.openrainbow.com/#/documentation/doc/sdk/android/modules/Push
Regards,
Cédric
-
Hi Cedric BRUCKNER ,
I have implemented the PUSH and when the application is in Active state(App Opened) application is receiving calls and messages, When application closed/ Killed it's unable to receive calls and message.
Thanks and Regards,
Vamsi K
-
Hi Vamsi,
If you are unable to receive calls and messages when application is closed or killed, it means that your PUSH implementation is not working. Could you share with us, application logs ? I am particularly interested in logs about the application startup and then logs when application is closed and supposed to receive a message.
Regards,
Cédric
-
Hi Cedric BRUCKNER,
Here I attched the link, Kindly help me out from this issue.
https://docs.google.com/document/d/1EEJfZieawuOaV562tzYlcdOrseP8eExRV46SknXPMoU/edit?usp=sharing
Thanks and Regards,
Vamsi
-
Hi Cedric BRUCKNER ,
Web RTC calls are working fine, recently I tested using rainbow SDK version 1.64.0 it's perfect.
Best regards,
Vamsi K
Please sign in to leave a comment.
Comments
13 comments