How to make video call with IceLink, when the peer app is closed - xamarin.forms

I have a Xamarin.Forms app. In it, I implemented video chat functionality (that supports iOS and Android) using IceLink. The video chat works when both the caller and the recipient have their apps open. Now I wonder how I can make a call to a device which has the app not open.

For Android
You can send notification by Firebase Cloud Messaging when device do not open, click the notification to open your application, show the video chat page.
If you use a high priority FCM for an app, it will allow that app to run services in the background for a short period of time. This would be a good alternative to having a background service that polls an app in the background:https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/services/#background-execution-limits-in-android-80
For iOS
You can refer to Jack's reply.
https://stackoverflow.com/a/60001529/10627299

Related

Sending an individual push notification to a specific user of webview Android application

Is it possible to send an individual push notification to a specific user of webview Android application?
I have a webview based Android application. Android 8 blocks all background processes and my application can not anymore check for messages every 5 minutes and to show push notifications is there are new messages. As I understand almost the only solution is to use firebase to show notifications.
My question is: can I send individual Firebase notifications to webview application users? If yes, how? People who login to my website from Android phones, enter their data in a login form that loads my website. It's not a Android login form. How can I at the same time login to Firebase and how Firebase will know that this user is already logged in if it's only a webwiew application?
A webview is not capable of directly receiving Cloud Message payloads. The only browsers that works with Cloud Messaging are those that support the Push API.
What you can do instead is receive the payload in the native layer of your Android app (using a normal Android integration with a service that receives the payload), then proxy it to your webview as needed, using webview's ability to inject javascript into it (while it's visible). This definitely is not a trivial amount of work.

How to create a "real" iOS push notification from Firebase topic messages if the app is not running?

As far as I understand messages on subscribed topics are received through the socket connection.
So while the app is running in the background I could create local notifications and "fake" notification that pop up on the home screen and are visible in the notification center.
But is there a way to receive topic pushes if the app is closed/not running in the background?
I'm grateful for any kind of feedback as I couldn't find any documentation regarding that specific use case.
Just to clarify: I am talking about (subscribed) topic messages in firebase NOT the firebase messages. I am used to the generic iOS push notifications handling and the involved lifecycle methods. All I need to know is how firebase topic messages can be sent via apns notifications.
With Firebase Messaging you can send notifications so the app is closed (it must be installed), basically it is configured in the AppDelegate the methods and configuration according to your need, you can see more information here Firebase Messaging
No you can’t, setup your configration in apo delegate and firebase settings, when the app is offline firebase talked directly to the APN which called the nitification center in your iphone but you don’t have access on it during the application is closed.

Web push notifications

I am making a website and one of the features is that whenever a contract is nearing its end, the user should be notified about it. So I was looking for a way to notify users and I found out about push notifications.
Now, there are lots of things written about it. I heard a lot about Google Cloud Messaging, Firebase Cloud Messaging and Service Workers.
Now the thing is that my website will probably be on an Intranet. So maybe I won't be able to use GCM/FCM.
But I have a few questions regarding GCM, FCM and Service-Workers:
Why do I need FCM/GCM?
What is the difference between FCM and Service Workers?
Is there a way to push notifications even if the browser is closed?
Because my website is on an Intranet, is there another way to push notifications to the users?
1. Why do I need FCM/GCM?
You may check here the features of FCM.
Notification payload: 4KB, Message payload: 2KB. Note that the notification includes device and app information too.
Stores 100 notification/messages per device if the device is offline.
Stores notification/messages for 30 days if the device is offline, and deleted them all one this period is over and the device is still offline.
FCM supports Android and iOS devices, and even chrome web apps. The notifications are sent to iOS devices in this way: App Server -> FCM -> Apple Push Notification Server (APNs) -> iOS device -> App.
GCM supports 1 million subscribers while FCM do not have this limitation.
Supports programming in C++.
Less requirements for coding.
2. What is the difference between FCM and Service Workers?
Service Worker is a background service that handles network requests. Ideal for dealing with offline situations and background syncs or push notifications. Cannot directly interact with the DOM. Communication must go through the Service Worker’s postMessage method. Service Workers are pretty perfect for creating offline-first web apps. They let you interact with the server when you can (to fetch new data from the server, or push updated info back to the server), so your app can work regardless of your user’s connectivity.
While using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user reengagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.
3. Is there a way to push notifications even if the browser is closed?
Check this thread: Notifications while browser is closed
4. Because my website is on an Intranet, is there another way to push notifications to the users?
Unfortunately, I don't see any documentation regarding this.
Hope my answers help you.

Is a Firebase Notification Received for a web app running on a mobile browser in the background?

The natural way to use Firebase on mobile is using Android or iOS.
However, I'm in this situation where a client who developed a web app wants to receive push notifications when:
The web app runs on a mobile browser
The mobile browser app is in background
Is that possible?
Note: According to Firebase Documentation, client web apps can receive push notifications when they are in background, but I'm not sure if that extends to web apps running on a mobile browser in background.
Yes, you can receive push notifications on your mobile even when your browser is not open, but you need to enable it by pressing Allow when prompted, as below.

Signal R Vs Push Notifications for real time applications like Chat

I want to create a chat application for ios, android and windows phones as well as it should work with browsers in the future. My search led me to using Signal R with Azure Mobile Services(AMS).
My questions:
1) SignalR uses Websockets under the hood. Is websocket supported in Android, IOS, windows phones and all mobile/desktop browsers??
2) If not, how will it effect using SignalR with AMS?
3) Or should I just use Push notifications supported in AMS?
4) Any sample app/code snippet you can share. Note that I will be using Xamarin for my app development.
5) Any advice you can give for same.
Azure Mobile Services has SignalR integrated, and Azure Mobile Services provide a SDK for client apps, I suppose it is provide out-of-the box
See
Real-time with ASP.NET SignalR and Azure Mobile .NET Backend
Master the Managed Azure Mobile Services Backend–Part Four
High value mobile backend capabilities included
You will find many capabilities included in Mobile Services and readily available for your Web API. Mobile push notifications, real-time notifications with SignalR (auto-scaled out), social auth for your consumer apps, offline data sync for occasionally connected scenarios, to name a few.
Samples:
https://github.com/gshackles/RealTimeGallery
Sample to help developers to implement Push Notification, through Azure Notification Hubs, in mobile applications.
Note:
Azure Mobile Service is based in WebAPI!
For that you want, you should not use only Push Notification because Push Notification in iOS could not be read by the application if the user ignore it, only in android or windows you can get and save it. Another thing that can be a problem is the fact if the app is running you should not show the push notification and you should show a pop up with the notification... and the push notification can have a delay from the Push Notification Service (Apple, GCM, WNS...). Push notification are a notification that something happened in the app when the user is not using it.
In my opinion you should use AMS+SignalR for realtime communication and then Push Notification for update the user then he not using the app.
Using SignalR is efficient to save yourself from hitting any push notification cap if you ant to limit your costs. But you'll need to either turn notifications on/off at the right time when the app becomes active or inactive, otherwise the app may go in the background and push notifications won't be sent.
You can use a pure push approach where notifications are shown when the app is inactive/in the background, and whenthe app is active, you simply intercept the notification in the app, consume it and cancel it so it doesn't get shown. I have written a blog post on this approach along with 3 samples in Github for iOS, Android and Windows Universal at http://www.ageofmobility.com/2014/10/06/azurechatr-building-a-cross-platform-chat-app-for-windows-ios-android/.

Resources