-
Notifications
You must be signed in to change notification settings - Fork 140
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
Can anybody help me in making the incoming call whatsapp like? Similar to Callkit integration of Twilio with iOS #95
Comments
I am able to open an activity to show the hangup and accept buttons whenever there is an incoming call. But I am still wondering, how I can do this when my keyguard is locked. Any ideas guys? |
Ok, so I found the reason, basically when my screen is locked, and if try opening the activity with the incoming fcm notification, onDestroy gets called and destroys the activity. Any suggestions how can I overcome this problem? |
@khurana3192 does |
@kbagchiGWC Thanks for getting back to me. We are planning to release an update to our Android app that is based on the Twilio Voice SDK. Our customers want a more native like experience where they can directly see a screen to accept or reject call (just like Skype/Whatsapp/Viber/Line etc), instead of clicking on the notification and then the dialog box. Moreover this should also work on the lock screen as well. As of now, I am successful in opening up an activity in my app and show the accept or reject buttons. It works both when app is in foreground or background. Here's the piece of code which is achieving this. I have modified the
Moreover, in the
The only problem now is that when the phone is locked, this activity opens and onDestroy() is called and I am unable to show the screen to accept and reject buttons. The desired behaviour I want is to have a mechanism where one can take calls even on the lock screen just like the apps I have mentioned above. I know this is a problem which is more related to how Android works, but any help in this regard from you guys will be really appreciated. I am sure people will benefit out from this discussion. |
@khurana3192 have you looked at |
@kbagchiGWC many questions on Stackoverflow points to Is Twilio planning to include the support for this, just like the above said companies? Can you point me in the right direction or a working example apart from that Android developers link? |
We don't have a sample for this at the moment but as you've pointed out there are other apps that do this so the support is available on the Android platform. We will consider adding a sample for this in the future but I don't have a timeline for when. It sounds like your close to a solution. My impression is that the attributes associated with your Activity may be causing the issue. I would review settings associated with https://developer.android.com/guide/topics/manifest/activity-element.html#lmode or https://developer.android.com/reference/android/R.attr.html#configChanges are resulting in |
@idelgado Thanks for considering this request, I am sure if you guys can do the same for your Android SDK, it will really help devs like us to cut down time required to ship a working VOIP app with Twilio. I would love to contribute in any such development if I get success with this problem of mine. Even if I ensure that Again, I am limited by time and was wondering if I can get a working solution to implement the same. |
@khurana3192 -- try this @OverRide //to turn on screen while its lock when call is arriving get required permissions in manifest |
I have added that method and also permissions in manifest. The screen does light up but somehow the activity gets destroyed and doesn't appear on the lock screen |
@khurana3192 If you are getting call while screen is awake then check if you are registering broadcast receiver in java class then do it in manifest and then try.. |
@abhinay-w3bminds are you referring to the registration listener function of Twilio SDK? |
@abhinay-w3bminds is there a way I can share my complete code with you after leaving comments so that you can help me better? |
@khurana3192 share it on github |
@khurana3192, have you found a solution for this or for ConnectionService? |
I am still looking for a pre-baked solution to cut down my research time :( |
I am also facing the exact same issue, the screen lights up and then the activity gets destroyed. I have already tried all the answers present on SO like setting windows flags, manifest permissions, acquiring wake locks. Nothing seem to work surprisingly. @khurana3192 Any help/ progress from the situation? @abhinay-w3bminds Any other pointers? |
@khurana3192 , @chakri1vr1, @rochapablo We have updated voice-quickstart-android It took us sometime to get to it, apologies for delay. Hope this helps. Please let us know if you have any questions. |
The PR with the changes can be found here: #143 |
This is awesome. |
@khurana3192 Is your code in github? What kind of issues are you having? If you provide details, we will try to help you as much as possible. |
@kbagchiGWC |
@khurana3192 You can send the gist link to my email. |
I am glad that your app is working as expected. Please close the ticket if you don't have further questions. Feel free to open a new issue for any future needs. |
@kbagchiGWC Thanks for all your help :) I will be glad to answer here, if anyone is facing this issue or trying to achieve the same thing |
Hi @khurana3192 , How did you achieved this functionality? did you end up using connectionService? |
Speaking as someone who's worked on inbound call notifications working across multiple handset manufacturers - trying to roll your own is much, much worse than just using ConnectionService. Be prepared to do extensive testing across Samsung devices, in particular. And pay attention to how they behave when they're locked and your app hasn't been launched and you get an inbound FCM message. Then add bluetooth headsets to your test matrix. And don't forget to test when the devices are showing the Samsung low-power always-on lockscreen. Don't forget about the new battery management stuff. (And then finally give up in disgust and just implement a ConnectionService, IMHO.) |
Hi, @banshee |
Not that I know of. We just said 23 is our new minimum version. |
Add one more thing to my list - do extensive testing with both native cell calls and your own calls simultaneously. Ordering matters, so test your call + incoming cell call, and vice versa. Test on multiple Samsung devices. Note that Samsung and Pixels will never, under any circumstances, do the same thing. If you don't hate samsung with a burning passion by the time you're done, you're not testing on enough samsung devices. Oh, and if you care, make sure you test on samsung devices that aren't sold in your country. The ones you have a hard time getting are going to have different problems than the ones you already have. |
is it working when the app forcefully killed from multitasking.? |
Actually, VoiceActivity.java file does not exist I have tried to perform searches in the project with:
There is no trace of lines of code that appear in the PR. |
@banshee I am not getting understand which way is the best to implement calling app like through FCM or ConnectionService. If ConnectionService is good to integrate calling app then Could you please demonstrate the connectionservice example. |
Did you implement this by connectionService? |
I have added this line of code in my app |
@khurana3192 can you please explain that how you solved this on your side. |
@Ranaamin0322 did you ever find a solution to this? I have the same issue |
@khurana3192 pls help if u were able to solve this |
i'm having the same problem too. can't wake the app when caller call using twilio. |
Has anyone actually implemented this using ConnectionService? I'm in the process of trying to implement ConnectionService into twilio-quickstart-android, but I don't want to duplicate work if anyone else has already successfully done this. I'm also open to collaborating with others if they want to help implement ConnectionService with me. |
hi Kody I have implemented a basic version of ConnectionService. Ready to collab for implementing with twilio. |
Ok that works! I can add you as a contributor to my project, do you want to do the same for me? |
sorry for replying late..yes sure u can add me or i can tell u how i m implemented it, in a call if it works for u |
again sorry for replying late here is the repo for bare basic code in Kotlin which implements connection service |
@lakshaydulani @KodyKendall Do you guys have any progress on Handling incoming call and showing native UI for incoming phone? |
@kbagchiGWC is there any way to listen to incoming call (non VoIP) without READ_PHONE_STATE permission? Uber and WhatsApp are able to listen to it. I tried to implement ConnectionService but even that is not working without READ_PHONE_STATE. |
I think this link can help you with this question. |
but Uber and Whatsapp do that without asking for runtime permission |
If you use the |
Nope, we still need READ_PHONE_STATE otherwise we won't be able to listen to the receiver - https://stackoverflow.com/a/63159603/8483843 |
That's because in that stack overflow answer, they are trying to use a |
@4brunu this listener needs to be attached with something right? how can this work?
|
Yes, to a context.
|
Unfortunately, looks like this no longer works on Android S, without the permission |
A bit late to the party - check out this impl for the twilio_voice Flutter package: cybex-dev/twilio_voice#151 |
No description provided.
The text was updated successfully, but these errors were encountered: