Is it possible to use Remote Config on Web with real time update? - firebase-remote-config

Following the doc below, we add to send FCM message to propagate updates of Remote Config.
Propagate Remote Config updates in real time
https://firebase.google.com/docs/remote-config/propagate-updates-realtime
But it's not working on Web because subscribing a topic is not working on Web.
Is it possible to use Remote Config on Web with real time update?

Related

How to get updates from the server promptly?

I have an iOS app which displays some information fetched from the server.
The app communicates with the server using REST API, and makes GET requests periodically (or when user pulls-to-refresh). However, we need better synchronization. As soon as data changed on server, we want to reflect it in the mobile app.
How can I get notifications from the server when data changed and update needed? I thought about silent push notifications, but they do not look a right choice here.
Are there alternatives? May socket programming help? I have no an experience in it, but I it is relevant, I will start digging.

iOS GPS track users location realtime

I'm building an iOS app that needs access to the location of the two users: driver and passenger. This app will be quite similar to Uber app where the passenger requests for a driver nearby to pick him up and eventually track the location of the driver real time. I'm new with location based app, so I would like to ask for best approach to do this. So here's my algorithm so far:
Passenger app requests for driver by sending his current location to the server
Server queries the nearest driver and sends push notification message to the selected driver
Driver receives the push notification message and sends confirmation back to the server
Server sends the details to the passenger
Driver starts sending his location to the server (every 10secs) thru REST API request
Server sends the drivers location to the passenger thru push notification
Thanks
I think send data through push is bad idea (use webscoket for example or request to server to REST).
1) Use CLLocationManager to get current position example, very easy
2) Use APNs to push or use firebase to easy send push
3) Just use REST
4) Just REST
5) Use CLLocationManager and by timer send current driver location. Use example from first paragraph
6) Use websocket or request to update info about driver location

Communication between asp.net app and a serviceworker, via signalR?

I'm new to serviceworkers and I wonder how could I connect my serviceworker to my asp.net application. My js client already is communicated with a service worker and it's able to show notifications.
However, I've seen that some webs (e.g facebook) send notifications even the browser's tab ins't opened (not inactive, not opened). I use signalR to communicate my app with the server. Would it be possible to communicate the serviceworker with the server? It would require to add signalR code to the serviceworker if I'm not wrong, but I don't think it's possible. I've seen that google has another way of communication, Google Cloud Communication
I can't use that, so any ideas of how could I solve this problem?
To make use of offline notifications (i.e., your browser is open but your page isn't), the browser itself needs to know about a messaging service that it can respond to, and which would let it know to wake up your service worker and give it a notification. These services are hard-coded into the browser. In Chrome's case, the service is GCM. And I believe Firefox is rolling out something of its own. You cannot wake up your service worker yourself from your server without going through one of these messaging services.
Remember that generally your service worker is asleep. The browser only wakes it up in response to specific events, and, if your pages are closed, there is no way to trigger a service worker event from your server, unless the browser provides a messaging service such as GCM.

AFNetworking and Push Notifications

I am working on an application which GET and POST information to a server. I am doing so using AFNetworking framework. My aim is to push a notification to a client whenever someone posts new info to the server. Eg: a new grade is published, the student who's grade was published must receive a notification on his iDevice.
Although I am not familiar with how Apple Push Notification works, from what I read I concluded that I need to add server side code in order to trigger a notification.
Note that I don't have access to the server. Service is provided by Fedena.
Any suggestions or hints from where to start?
APNS needs a server in order to work. The usual flow goes like this:
The iOS Application asks user to enable push notifications
Upon access granted, a device token is generated and then must be sent to the server.
Your server must be setup with the proper APNS certificates generated from the Apple Developer site
Then in your server's, when a new post is created, you need to add some logic where you load all the APNS token you've received already and then send the notification to the devices.
This is a very simple flow description but I guess you understood that you need to have access to the server to be able to do what you are trying to achieve.
Some third parties exists to handle push notifications (like Urban Airship), but those push notifications are usually pushed manually from a person, and not triggered from a server event
I recommend that you can use secondary server of your own as intermediate and use it as infrastructure back bone.You can use SignalR library. Use secondary server as to create connection between two devises. One client will push events and another client will listen to events.
Here is the link to the signalR library code written in IOS.
I am currently using these library. What you can do is start hub and connection using these library.
This library allows invoking method on server. Something like this.
[_hub invoke:#"MehtodName" withArgs:params];
What i would do is to create event registry on server. So one client can listen to event on server and other can push events or vice versa.
So your student device can invoke method "subscribe to events" and server will add it into the registry list. You can create secondary service "Publish Events". Grade publisher can publish via calling this method. Here publish events will look up registry and find interested clients and call desired method on client.
Read more about signalr through this site.
Benefit of using Signalr Over APNS.
Cost Effective. As this will save you money which you might have to pay to Apple for pushing notification.
Can Easily make it cross plateform in future. Just have to impletement similar library in Android/Windows.
Quicker as the data does not travel to apple server from your server.
Worst case you can fallback to apns any day, just put push notification code in any of your secondary server methods.
I have done battery and performance testing as well and works perfectly fine.
If you wanna know, here how it handles connection which is very reliable.
SRAutoTransport chooses the best supported transport for both client
and server. This achieved by falling back to less performant
transports. The default transport fallback is:
SRWebSocketTransport
SRServerSentEventsTransport
SRLongPollingTransport
Let me know if you have anyother question. i am currently doing similar work, might be able to help you with your issue.

Suggtestions for sending e-mail notifications from a 2 tier application with client potentially not connected to the internet

I have to add e-mail notifications to a client server application.
Notifications happen as the user do some particular action on the client UI.
If I had a middle tier or a service running at server I can imagine how to do it:
1) I simply create a DB tables with "pending notifications"
2) as a user does an action that generates a notification I add a record to the table
3) serverside I would continuously try to send those mails and removing them from the table once sending is succesful
Now I cannot do this now, I have a plan to add a service later on, but for now I must go the quick and dirty way.
So somehow what I was thinking to is to implement something like this:
1) as a notify-worth event occurs at client, the same client (my exe) tries to send the notification, upon failure it will log the notification in the "pending notifications" table (failure can be becuase lack of internet connection or any other problem)
2) I add a Timer that will work from any client machine to check for pending notifications. If there are any the client will try to send the e-mail (using a transaction: I will mark a field as "TryngToSendFromClientX" and in case of failure I will reset that field to NULL)
I think this approach would work, it has obvious limitations (if after failure no one logs into the system, no notification will be sent - same would be if service goes "down"). But can you comment on this approach and suggest a better one?
Additional notes (to better understand the scenario):
a) Note: all notifications are sent from the same e-mail account.
b) I don't need to keep track of who sent the e-mail.
c) the problem of creating the service now is that it will basically complicate significantly deployment and I need to create tools for monitoring the status of the service. Something that I will do in future but not now, in future I have plan to add more functionality (not only sending notifications) to the service, so in that case it makes more sense to create it.
d) I will send e-mails by using Indy components and SMTP server.
If you are not willing to create the service now, I think you are stuck with the scenario you describe. There are some things though you could do to circumvent the problem of no user firing up the client anymore while there are still pending messages.
You could add a commandline utility (or commandline parameter as bepe4711 suggested) that will only check for pending messages and try to send them.
Add this commandline utility to the StartUp folder or Run key in the registry. This way messages will at least get sent when the computer restarts, even if the user does not fire up the your app.
Add a scheduled task to run this utility at least once every day. The scheduled task can be added by code or by your installer.
If you do both, you will only have to worry about pending messages of users that never start their computer again.
Perhaps you can add a parameter to your client which causes it to just look at the pending notifications and send them. After this it can terminate itself. It will just act like some kind of service.
Then you install the client on the server and start it every x minutes.
I do something very similar to the approach you describe. Instead of sending emails I need to call a web service. My application is installed on several laptops and they are commonly not connected to any network.
When my application raises an exception I collect various bits of information including user comments and screen shots. Then I attempt to send this to our web service. If by chance the web service is not available. (i.e. not connected to the internet or web service is down) I write the results to an XML file on disk in the User Profile (App_Data) directory.
The one major difference is I don't poll to check to see if the server is up. I attempt to send them again on the startup of the application.
If both Systems are running on Windows, have a look at MS Message Queue. It is designed to send notifications to systems, which are not allways online. I did it in .Net, there are already easy to use classes implemented. Not sure about Delphi.
Latest version of Windows uses much more the Windows Task Scheduler, and now task can be fired on event (i.e. when a network card gets connected...). You could write a separate utility that tries to send pending notification, even if noone is logged in.

Resources