How can I integrate my video chat with Telecom? - android

I have a Xamarin.Forms application that has a video chat feature. Currently, a video call is made by sending push notifications using Firebase, and is answered by touching the push notification. This is not a good solution, as a push notification may come too late, and it may be easily missed. I would like to use a native android telephony feature, that would let the user make a real phone ringing etc. I know it could be done using Telecom, as shown here:
https://developer.android.com/guide/topics/connectivity/telecom/selfManaged#incoming-calls
But I cannot figure out how practically I can integrate the telecom api with my application. E.g. should I keep push notification, and somehow make the incoming push notification get converted into a real phone call?
The article mentions for example,
onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)
The telecom subsystem calls this method when your app calls the addNewIncomingCall(PhoneAccountHandle, Bundle) method to inform the system of a new incoming call in your app.
I don't see where this addNewIncomingCall() method is defined, or to what class it belongs.
Is there any example and/or explanation somewhere that would help me implement this?

Related

How to receive calls/messages real-time when the application is closed

I am developing a VoIP application with SIP as the signaling protocol. I have implemented the messaging and calling functions and they work when the app is in the foreground. To make the app listen to the call and message receiving when it is closed, I created a foreground notification so that the app would always be in the foreground.
The problem is that the above method consumes a lot of power which is unacceptable. I have also noted that famous VoIP applications like WhatsApp and Signal are not using foreground notifications but, they manage to inform us about incoming calls/messages no matter the app is closed. I wonder how to achieve the same functionality. Could anybody please point me in the right direction?
This kind of App should use Push Notifications (reference: https://firebase.google.com/docs/cloud-messaging) that use ONE SINGLE socket connection for the whole system: each App should register itself for receiving Push, then when the Server triggers (many languages are supported by FCM with examples/tutorials) the Calling Event then a special "message" is sent to the App (providing some information about IP or whatever you want) that gets those information and acts in the proper way.
Unfortunately FCM, after few thousand notification per month, requires payment.
There are other similar online service, but those services requires a fee because they should handle many users connected at the same time and it requires hardwar and bandwidth.

is it possible to use Eddystone to trigger FCM(Firebase cloud messaging) for richer notifications?

My intent is to send a user push notification through FCM when my webapp user(already subscribed to notifications) comes near a beacon transmitting Eddystone url. If the person does not have the app installed I would like the Android nearby notification to trigger but if the user is an existing app user who has already subscribed to app notifications, I would like to silence/suppress the nearby notification and use the eddystone-url meta:title and/or url to instead trigger a specfic push notification.
Even as I'm asking this I know for this to work, users Phone have to send a signal to my apps backend to trigger the FCM send. Not sure how though. Any guidance or alternative to show a more richer notification to existing app users would be greatly appreciated.
Great question, and great idea. Let me first summarize/clarify your question to make sure I have it right:
If your website/app is not yet installed, you would like Nearby to create a Notification whenever it is close to your Eddystone-URL beacons (to help drive incoming users). This is working well for you.
However, once your website/app is already installed, you would like to control Notifications yourself. You would like help accomplishing this.
I think there are two parts needed to solve this problem:
How can your website/app know when it is near an Eddystone-URL beacon?
How can your website/app let Nearby know it shouldn't fire a notification?
For (1), websites are not currently able to scan for Nearby beacons. There is an exciting new WebBluetooth api coming to the web (launching in Chrome very soon!), but it is not yet able to scan for beacons. This is something we hope we may get in 2017, but its not possible yet. Apps, however, can easily scan for URL beacons using the system Bluetooth apis.
For (2), I do not think it is possible yet to ask Nearby not to fire a notification conditional on your website/app being installed. However, I know this is a feature request we get from time to time and we are considering ways to support this use case. If all goes well, we will have something for you in 2017 around the time that (1) gets solved.
So, apologies, I don't think this will be possible for you to do today, but I do think its a great feature requests and I'll bring it to folks' attention.
(I also think Push Messaging is a red herring here, since you should be able to control notifications entirely on-device with Local Notifications).

Twillio IP Messaging Notification - Channel Settings

I'm mainly reaching out to the Twilio team active on here 😀 and for the benefit of the community.
Our team will is looking to implement Twilio IP Messaging to fulfill our app messaging requirements. One of the use cases we'd like to handle is the ability for a user to turn off notifications for a specific channel. I don't see anything in the docs that speak to this, so we could of course implement the logic on our servers. But, I don't see the ability for a pre-event callback for something like onNotificationSend to check if a notification should go to the user. I don't want to use onMessageSend since the message should still go out, just not the notification.
My other thought would be to intercept the notification in the app and check our app state to see if that channel is able to receive notifications. Reading the docs for iOS notifications, it looks like I can determine what to do with notifications outside of the app being open, I just wanted to check if that was the best/only option for this scenario.
Thanks in advance for any help.
-Brad
I got the opportunity to talk to the Product Manager for IP Messaging at the Signal conference, and he said the ability to mute channel notifications is in the road map. So I think I'll wait to implement something until that comes GA.

Send a data to one android phone to another android phone

There is a scenario where I have to communicate from one android device to another android device (Far Away). But without using any server or sms service. Although I do have an active internet connection. I found a way through GCM, as GCM service provide data upstream as well as data downstream.
I want to know is there anymore way of doing this ?
You need a notification service, and google has something like that for us...
how does this works??
Take a look at the image below,
you need to register your android app in the google service, and your web interface will need an id, so everytime you want to push something to the android, your web interface instead will push it to the google server with the Id of the app, then google (no matter how) will localize your app, and even if its not running, they will get the notification,
behind the scenes there is a couple of thing that you must do, bu nothing like launching rockets from the NASA.
I will suggest to take a look to some tutorials
in order to start with the registration of your app, get the api key etc etc..
In your case
you will need the id of the other phone, so you can push it data.

Xamarin crossplatform, how to reliably send events from server to client

I'm creating video chat (like skype, but for a specific type of companies) apps for Android and iOS using Xamarin. I'm wondering what the best approach is to handle the server to client communication, specifically when a call is coming, how do I fast and reliably contact the receiver ie client phone?
I want to be able to contact my App even if it is closed
I need to know if the message have gone through
It has to be fast, preferably under 1 second
I've read about push notification and they can wake my app, but they are slow and no guarantee they will get through.
I've been looking into SignalR which are fast and reliable, but I can't quite see how to open my app.
Currently I'm thinking about setting a status wether or not the app is open. If it's open I'll use signalR else the caller will be asked if he wants to notify the receiver about the incoming call. Does anyone have better idea?

Categories

Resources