Send Push Notification In Xamarin Forms Without Firebase - xamarin

I am working in banking sector and we have different portals for managing employee information, performance etc. I want to send push notification in mobile app from our asp.net web service when a new event (e.g. a Line Manager has to approve any pending request) occurs. How can I send notification to mobile app from our servers(where the web service has been deployed)? We don't have rights to place employee data on cloud servers or cloud databases.

Hopefully this is your request:
We don't have rights to place employee data on cloud servers or cloud
databases.
And not this:
Send Push Notification In Xamarin Forms Without Firebase
As they are entirely different. If you want to send data to Android devices you need to use Firebase for that just like you need to use Apple's servers for iOS devices. However you don't need to have any database or store data on them.
You can use PushSharp nuget if you want to minimize 3rd party server usage or some other similar solution.
Just for the record using Firebase (or other services like Azure) to send push notifications doesn't require you to place employee data on cloud servers either. Firebase and other solutions contain range of services that can be used independently and it seems that you consider them as all or nothing solution.

Related

Alternative of cloud functions

I am developing an app for elderly for my graduation project. There are 2 actors, elderly and the watcher who takes care of elderly.
'all application data stored in Firebase'
My app reminds elderly about their medication time and to check their blood pressure and glucose.
Also, there is a chat between elderly and watcher.
My question is how to push notification without using cloud functions?
I have watched a Flutter course and he used Firebase Cloud Messaging and Cloud Functions, but now Cloud Functions requires to upgrade project's billing plan, so it requires money and credit card, and I don't want to spend money for my graduation project especially that I don't have a huge knowledge about flutter.
I watched a YouTube video that someone explains push notification using Laravel with Flutter, but I afraid about that because I DON'T HAVE ANY IDEA ABOUT Laravel.
Also I see that there are many Flutter packages for push notification, but I don't know how to use it or if it uses a Cloud Functions or not. such as: awesome_notifications, flutter_local_notifications, pusher
I hope someone guide me to the right way.
in order to send custom notifications you can create your own server environment (backend) and from there perform all the logic to be able to send the notifications to the devices.
The only thing you need to be able to send a personalized notification from an external environment is to have the token device, in the case that you will send it to a specific person, you can also send notifications if the devices are subscribed to a topic.
This is the documentation to send notifications from a server to the device:
https://firebase.google.com/docs/cloud-messaging/http-server-ref

How to build real time notifications in a distributed project?

I wonder to know which technique and tools I should use to have the ability to send real time notifications to users. Specifically if I build a messaging system.
I can see that modern social networks can send notifications about new messages almost immediately. Even when the user 'A' from one country writes a message to the user 'B' in another country you can see that the user 'A' writes a message and you immediately see it (even if those users live in different continents).
I tried to figure out how it is possible and find any information about this but without success.
The only thing I found out is the technique when we use a Redis or RabbitMQ server with several servers which acts like publishers and subscribers. Our API servers receive new messages then they push a new message in the queue then subscribers receives the messages and if they have an open WebSocket with the recipient they push this message in the WebSocket and a client receives the message.
But it really won't work if you have a distributed project and your clients are connected to the nearest servers in the nearest data center.
The question is: what technologies/techniques/anything we should use to be able to build notifications in a distributed project?
If you develop your distributed app/system using web technologies, you can consider building what is referred to as a Progressive Web App. With PWAs you can add push notifications in a relatively easy way. You could start with a PWA approach, and then decide later on if developing a native app as well (i.e. iOS or Android) would be necessary.
There are many resources to learn and guide you in developing progressive web apps. Check the references I mentioned above, and you can do this codelab as a starting point.

Intercepting PouchDB communications with CouchDB backend

I am considering PouchDB & CouchDb as an alternative to Amazon Cognito Sync for a hybrid mobile app that will need data synced between devices and users. I have pouchdb working in a small sample app that syncs with a local couchdb.
I need to be able to intercept the communications back and forth between the pouchdb and couchdb in Java in order to do things in response to these sync events. Sort of like Amazon Cognito Sync's sync triggers. Also, I keep thinking much like Spring's AOP around.
Since the couchdb has a rest interface, I thought I could point the pouchdb to my application server which has a controller listening for any request with the db name as the base. When a request, from pouchdb comes in the Java Rest Controller can optionally do something, then forward the request to the real rest endpoint of the couchdb and get a response, then optionally do something again, then return the response to the pouchdb.
Does this seem like a feasible solution? I am currently working on trying to get this concept working. Has anyone else done anything like this? Any major pitfalls to this approach? Currently, I'm using Java 8 with Spring Boot & Jersey.
I think the architecture goes like this:
Data is empty everywhere.
Data changes, the device where the data changed pushes via a REST APIs.
Your server "master", send notification GCM or APN to devices.
In your notification listener, you check the type of notification and you sync the data.
If a new device connects to your "list of devices to sync" you send a push notification to sync the data.
Keep a list of connected devices.
The same ideas goes for every device/web browser. You have a local cache that you push to the "master" if it changes locally.
You will have many cases to deal with, and I don't think there are open source projects that offers the same patter as Cognito Sync.
Also think about scalability, devices don't have to pull your "master", the master sends notification to trigger devices to download the data.
You have to deal with diffs, regular checks, and so on ...
Good luck

Client Side Transactions in Azure App Service Offline Sync

Is it possible to leverage transaction on the client, when using azure app service offline sync?
It seems to me that you can pretty much only insert into the SQLite store a record at a time, but ideally i'd like to be able to commit multiple records in a transaction.
I'm using Xamarin with Android right now,but will be also supporting iOS.
Thanks
Matt
Unfortunately, on Windows, Xamarin, and Android you can only commit one record at a time on the local MobileServicesSQLiteStore. This is because changes need to be made one at a time using methods like SyncTable.UpdateAsync, which is how you mark a change as being tracked to send to the server.
On native iOS, the Mobile Services offline sync feature uses Core Data, which does support a form of transaction (https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdMemory.html). If you use these APIs, you still need to make calls to the Mobile Services SDK methods to track each individual change in the internal tracking tables.
Why do you need transactions on the client side? There might be a different way to achieve your goal.

Ways to associate an App Store App and a Desktop App

I am working on a product for Windows 8 that needs to perform some low-level tasks, display some UI, and communicate with an external server. I definitely need a Windows service to accomplish the low-level tasks. At the same time, I would like to use the cool features of Windows App Store apps, like push notifications, live tiles etc... for the UI. In this design, both my service and my app would communicate with my external server.
The flow would be something like: my Windows service sends some information to my server, which then sends a push notification to my App Store app.
I understand that deployment is not pretty in this scenario, but let's put that aside for now. My problem: How does the server know that the service and the app are on the same machine, and consequently linked together? i.e. When my Windows service sends information to the server, how does the server know where to send the push notification? I need is some sort of shared, unique, identifying information.
I have seen lots of discussion (usually frustrated in nature) about the lack of inter-process communication between App Store apps and desktop apps. In my case, I have two options:
Generate the exact same unique identifier in the service and in the app. This seems unlikely because apps don't seem to be able to access very much system-specific information. I'd love to be shown that I am wrong about this.
Generate a unique identifier in the server OR in the app and communicate it to the other component. Potential ways to do this:
Create the identifier in the app, save it to a file, and then access the file from the service.
Some sort of local socket solution (I've read this doesn't work, but have not tried)
Of course, option 2 seems likely to violate the Windows 8 app Certification Requirements, notably:
Windows Store apps must not communicate with local desktop
applications or services via local mechanisms, including via files and
registry keys.
Any advice would be most appreciated.
I'm not a lawyer, but if it says "via local mechanisms" then you could still possibly communicate via a cloud service as long as having both apps installed isn't necessary to have some features in the app or if you don't mean to publish the app in the store.
You could save some sort of a token in the documents folder or if your desktop app can run with appropriate permissions - it could access the local data folder of the Windows Store app to synchronize the token for use in communication with the web service.
Perhaps the user could just be asked to copy and paste a token between the two apps?

Resources