I am developing an android app and having a problem on the notification part of the app. I am planning to push a notification whenever a new announcement is recorded to the database even if the user does not run the application. The scenario is like having a notification when a facebook user adds you as a friend. Even the user did not open the facebook app, the application ,in the background, shows a notification that says someone added you as a friend. In my app I am going to show announcements whenever an announcement is added to the database. For me the problem is how to make my app to work in the background to check whether there is an announcement newly added to the database.
Thanks in advance.
You can be writing your app as an android service..
Related
Good morning can you please answear my question Am Using a script called WebViewGold i want to know How to link between Website database and WebView To show Users notification (Message ,comment ,likes ) our site have hyber mobile version and we want to convert to native app using WebViewGold we have in-app notification work great but the problem its when user not Using his phone he must get Notification about what happen in app (if someone send him message or gift for example) are there in Way using WebView to show Push notification In real time When app are closed ?
i want to know How to add Notification on webview App android
I have used Onesignal for push notifications in my android application. I am getting notifications properly. When the app is closed the notifications comes on notifications bar correctly. But I nee to show the received notifications with my custom dialog, when the application is opened. I have tried it . But I couldn't be achieve. Anybody can help me to do this?
Use sharedPreference or SqLite to store last notification and show when app open next time.
Here is example when and where you need to store notification message . You just need to get that message when user open app next time or when click on notification.
Answer given by manoj
I want to display a notification to my android app from this website. I want to display the blue square that says Season 2018 is closed as a notification on my android app. This quote is added by the admin of the page so I want when he adds more, to display them as notifications. Is there a way without having access to the database?
UPDATE
Or if it's any way to display the notification when the admin updates the database.I've seen firebase notifications are good but i want the admin not to go to a firebase page,instead he will continue uploading from his webpage(there are more than one admin also).
In Android, for push notification, you can use Firebase notification. It's easy way to add notification functionality in Android app.
https://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Open this link and follow these steps to implement push notification.
I've just implemented a notification feature on my RN project using RN firebase. I have sorted the parts where user clicks on notification and it triggers something in the app when it opens.
HOWEVER, I'm currently struggling to understand the flow of most apps out there where the case is like this:
User received and ignored the notification
User then later launch the app manually without tapping on the notification
Most apps I know, esp Instagram and Whatsapp would be able to still show in-app badges letting user know that they have new items incoming and highlight the newly received items
Now, I have successfully done the in app badges part in case user received the notification while app is in foreground, just like what Instagram and Whatsapp does.
But I just can't figure out how to identify, on app manual launch (not tapping on notification banner), if the user have some unopened notifications on the tray except by checking firebase.notifications().getBadge(). Problem with this, is that I wouldn't be able to know what do the new unopened notifications contain...
I have a feeling this is not something to be handled by notification module or firebase per se because this part has nothing to do with opening up a notification object on arrival.
Basically, I'm really not sure where to look right now. Any pointers would be highly appreciated :D
When a notification is delivered and the user did not open it, you need to store it somewhere and retrieve this data when the user opens the application without opening the notification.
For Android, you can use Shared Prefences and for iOS, you can use NSUserDefaults.
You can store the data as a stringified JSON. So when a user starts the applicatio, you can get the data from here and prepare your application according to these data.
If a user clicks on the notification or launches the app after getting your data, you should clear out this place to avoid data corruption.
I have a very simple app made with android studio, an web viewer for my forum app. I integrated push notfications to be able to send notifications like "Hi! There are some new subjects on our forum, check it out" and make people open the app. I followed the exact documentation from here https://pushbots.com/developer/docs/android-sdk-integration
I am now able to send notifications to all the users that have my application. My problem is that they dont see the notification unless they have the application opened. For example, if I test it and send a push notification, but i dont have the app opened, i wont receive anything. I want to be able to send notifications even if they have the app closed, that's my point, i want to make them open the app to see the new questions on my forum
What should i do?
Make use of what was formerly known as Google Cloud Messaging and is now known as Firebase Cloud Messaging. Can push messages to user phone even when app is closed