Push Notifications When Database Updates?

DemonolithDemonolith Member ✭✭
edited December 2018 in Xamarin.Forms

Hey, I'm tackling an issue I'm not sure how to overcome. I have an app that displays news stories. It draws the news story data from a database through a REST API (built with PHP) and http requests.
What I want is, even when the app is closed, the user gets a notification when a news story is added into the database. I'm not quite sure how to do this, I've got notifications to work but it's then connecting it to the database / REST API.

The way I've thought about doing it is a timer on the app that is called every few seconds and performs a http request, however this seems like bad practise and won't even work if the app is closed.

Any ideas? Thanks!

Best Answers

Answers

  • Nadjib_BaitNadjib_Bait DZMember ✭✭✭✭
    edited December 2018

    Well just push your notification, then in your notification receiver, pull the new articles and save them to your local db (or cache). iOS has a special kind of notification called Silent Notification that does exactly what you want. You can implement the same for Android using your broadcast receiver/service.

Sign In or Register to comment.