Currently I am using twilio video for video calls from mobile to mobile. I am using FCM push notifications to start calls. Is there a better way using a real-time way to handle calls between devices. Just looking for better reliability since push notifications can be inconsistent.
Not exactly sure how real-time would work with app in background/closed when starting calls.
I think make it a background service so that it runs unless the user terminates the app
Twilio developer evangelist here.
On iOS you can use CallKit to create push notifications that behave like an incoming call. The Twilio Video iOS Quickstarts repo has an example Twilio Video CallKit application you can look into.
I'm afraid I don't know of a better way to do this with Android though.
Related
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?
I wonder how to push notifications to my Flutter app users in both Android and iOS devices Without using any external service like Firebase or OneSignal?
I want to implement a code in PHP which can send push real time notifications to all/spesific users in my Flutter app which works in both Android and iOS.
I found some solutions like flutter_local_notifications with workmanger which can fetch the API in the background only minimum 15 minuts. Workmanger is Not good solution because its work only during 15 min and it will consume the battery and internet.
I need an efficient solution to my flutter app for both Android & iOS devices, which can listen on real time to the coming messages from the server even when the app is closed.
How to fix that? thanks
iOS
You will always need to integrate with Apple's Push Notification Server (APNS) if your app needs make API calls in the background. The reason is that once an app is put into the background, iOS will often put the app to sleep soon afterwards.
The correct approach to this is to use a silent push notification to wake up the app. When received, no message is shown on device but the app get's about 30 seconds in order to make API calls.
In your case, the app can make the API call and then schedule a local push notification to display your message.
Background updates via push notifications
Scheduling local push notifications
Android
It looks like WorkManager is your best bet. I don't see how it can affect battery.
FYI
You don't need to use Firebase or OneSignal for push notifications, silent or otherwise. They are simply 3rd party services that interact with the official Apple or Google Push Notification Servers.
Unfortunately, I think this is not possible. Even OneSignal uses the Firebase API to deliver the notifications, as you can see here. For all other solutions, you will have to balance the update frequency with internet use and battery consumption.
I am writing a mobile application in Flutter, which is Google's SDK for developing mobile apps.
Basically, I was researching into how to mobile push notifications and every source I could find would point me in the direction of Firebase, which is Google's mobile and web application platform. Firebase is extremely nice and makes it really easy to send push notifications from user to user,
but I would like to learn how to do it myself and I can not find documentation to do that.
All I could find was creating a Dart Isolate in the background of my application to solely listen for incoming notifications. The Firebase plugin for Dart, from what I can gather, does just that; creates an Isolate to listen for notifications, even when the app is closed/user has killed the app.
So my main question is, is it possible to create an Isolate in the background to keep a WebSocket connection alive at all times that would listen for data from a server, and then push that data to the screen in the form of a notification without the use of Firebase? (I have created a server in Node.js, and it would be cool if I could just handle all notifications from my Node server). Thanks!
Of course you can implement push notifications without Firebase. Do a web search for “list of push notification services” and you’ll see lists of a variety of services out there. And, on the iOS side, you can have your web service interact directly with the APNs, and have no third party service (such as Firebase’s FCM) involved at all. On the Android side, though, FCM is probably still the logical choice. It’s easy, scalable, and is free.
I would not suggest trying to keep a socket connection alive at all times, though (if that’s what you’re contemplating). First, you won’t even be able to do that on the iOS side when the app is not active. Second, these push notification services are designed to solve the problem that web sockets introduce, namely the user device resource drain and the cost of maintaining a scalable server to maintain all of those connections.
Sure, use sockets where you need them (e.g. near-instantaneous communication while the app is active, etc.), but it’s not the right solution when the app is no longer active.
For iOS side, I would love to point you to Send Push Notification Through APNs Using Node.js. I tried it with my own node server and found it super easy.
I'm an iOS app developer and not familiar with Android. I'd like to implement the feature that playbacks audio over the internet when the mobile receives a push notification.
I've investigated it for iOS and concluded that it is impossible in iOS because Apple prohibits downloading data over the internet in background from being developed.
I'd like to know if this feature is feasible or not in Android. Could you give me any advises ?
You need to implement PendingIntent to get you notification and start ForgroundService or this or this to play your audio and close it when the user leaves your app or while they are using your app depending your particular needs.
I'm developing viber like application using the ionic framework.
I want my app to be able to receive calls even when its on the background, just like whatsapp, the incoming call screen will pop up even if whatsapp is on the background or even when there is no instance of it at all.
I wasn't able to find anything about it.
I'm afraid there's no other way to achive this, then using Google Cloud Messaging (GCM). Although there may be other services that do the same.
When using GCM, your app will be notified with a notification even if it is not running.
But be careful! As your using Ionic, you will most likely rely on a cordova plugin to receive the notifications that are pushed to your device via GCM.
It depends on the chosen plugin how it handles the incoming notification.