Programmatically fire push notification from Azure web service? - android

I'm using Azure for an Android mobile app backend. I have my app service, a server and DB, as well as a notification nub. I've already got the notifications firing to the device properly when press "Test Send" in the Azure dashboard, but I'm trying to listen to the database and whenever a new entry appears in a particular table I want the user to recieve a notification with that information.
I can't seem to find any commonplace way to do this directly in the Azure dashboard offered by any service.

There isn't anything you can "auto hook up" to be notified of a database table change in Azure App Service. You'll have to code up a process in your application to periodically check for new entries in your database and then fire off the notifications. To do this you can either use a Continuously Running Web Job, an Azure Function, or even an Azure Logic App connected to your database and Notification Hubs.

Related

How to send Notification to a mobile when a specific changes is happens on database?

Ian newbie to the android mobile app.
I need to send a notification for a user when a new ticket is opened for him in a database that means when a new ticket is inserted in the ticket table I should send a notification to the user till him that.
Please note that tickets open from a web application and the notification need to send to a mobile app.
it should be a realtime app.
please note that I have an existing database on SQL server.
I tried to used the job scheduler to send a notification to the user by calling a web service each one minute and if the new ticket is inserted then send a notification the problem with this solution is battery consuming and it's not considered as a real-time app.
The solution is creating web API which send push notification using the "app center" to users. then in the database create a trigger which calls this web service when a new ticket is inserted.
by this solution, I don't care from where this ticket is opened from mobile or web or any other way.

Use FCM with another database

I am developping a mobile application that must implement push notifications. Documents are stored on a SQL database, and people should be able to edit these docs after downloading them offline, then the modifications should be saved in the SQL Database once the phone is online again. People should be able to receive notifications when the app is closed.
I heard that I need push notifications, and for android there is Firebase Cloud Messaging (FCM). But is it possible to use FCM with my SQL database ?
All tutorials in the docs only speak about connecting the app with Firebase
For your project you need a server with your API, SQL Database... and a push notification server that ask FCM services to notify your registered devices.
FCM works like that :
You add the FCM plugin in your Android/iOS app, then when you launch the application it will ask FCM for a unique token associated for your device and this app. You will store that unique token in your push notification server, I advise you to associate it with a user identifier or one thing that you will use to identify the device to notify.
When your first server (with the APIs and the Database) did some action and you want to notify a device :
The server will ask your push notification server to notify a list of devices that you will probably determine with the user identifier like I said earlier, then the push notification server will find the associated tokens and send all of the pre stored tokens to FCM with the notification content you want to send, you can also send parameters that will be used to do special actions in your mobile app.
Finally FCM will notify your devices :)
Hope it helps.

Real-time database triggers Firebase notification vs. FCM

I see here is event triggers https://firebase.google.com/docs/functions/database-events for RTDB and I watch onCreate() method.
onCreate()`, which triggers when new data is created in the Realtime
Database.
When I create new insert into RTDB in this method I can notify user about new insert into database.
But my question is now I can make here notification and all mobile device in same time get notification?
Why I need to use FCM. With FCM I can choose which mobile device get notification and many more features about notification?
The Firebase Database client in your app is (normally) only active when the app is running and in the foreground. So it can only receive the new data, while the user is actively using your app.
The Firebase Cloud Messaging SDK includes a service that is also listening for messages when the app is not in the foreground. That means that with FCM you can also notify the users when they are not actively using your app.
It is quite common to use a combination of the Firebase Database and Cloud Messaging:
If one user changes the state, write that change to the database.
Then use FCM to notify the other users that "something" has changed.
Finally when the other users open the app again, the app gets the latest state from the database.

Android User Specific Push Notifications

I need some advice on sending pus notifications to my android app built in android studio. I have done a lot of research on the subject but it seems that all the examples, tutorials etc sends one notification to multiple users (similar to a news app that sends a notification about a new article to all of its readers) using GCM, pushbots etc.
What I am trying to achieve is to send a specific account notification to a specific user (similar to a facebook push notification when someone writes on your wall or the bank sending a push notification when a transaction occurs on your account).
The backend data will be on SQL server and as data comes in to the server, notifications needs to be sent to the associated user.
I am not sure if the processing of this happens on the server and then just pushes the notification to the users android device or if there is a service running on the android device which runs in the background and periodically checks for changes in the data and then gives a notification when it detects a change in the data based on certain conditions (more like a pull notification if you will as the android device actually pulls from the server).
Any advice as to where I can start and do more research regarding this will be much appreciated.

server update device not in use

I am developing a small chat application using node.js for iOS and Android, Now my question is that one user created a account and logged-in using this application from iOS or Android, then the user deleted this application without log-out. How the server knows this device has deleted the application without log-out?. Since, while user again installing this application, the push notification is still arriving without the user log-in.
Apple has a feedback service to give you information about failed remote notifications. Basically you listen the messages from feedback.push.apple.com and you flag the devices returned from feedback service. So no further push notifications will be delivered to that device. When user installs your app again you can remove the flag and start delivering the notifications.
For the android part check this question; Is there an Android GCM equivalent to the iOS Push Notification Feedback Service?

Categories

Resources