How to send and receive push notifications in android app? - android

I m making a carpool app and I want to send notification to rider that I am leaving and I am coming to pick you so how can I do it ?
I tried doing it but it was happening manually and It want to fetch data from the google firebase database.

Related

Android notification Screen

I'm creating an ecommerce app and I want to send promotional notifications to users from firebase cloud messaging. I want to show all the notifications in recycler view in notification screen using adapter can anyone tell how do I save all incoming notifications and display them in notification screen
If you want to show all notifications you need to save those in
local database when you receive and fetch all on required screen.
You can use Room database for the same.
You can ask the backend developer to save all notifications at
backend side and fetch those by an API.
Approach 1
See If you are sending a notification from the firebase console, Then you need to save that notification in the local DB While It receives in Mobile Firebase Messaging Service Class. (but It's not a good approach, Because user loss notification in case of clear data for app or reinstall app)
Approach 2
If you are sending notifications using some API or firebase function Then you can create one collection of Notifications and save notifications every time while sending And Fetch notifications from the same collection.

How to stop android app opening from push notification

I want to stop my Android App opening automatically when I click on the PUSH Notification send via Google FCM. I have changed the message type from Data Message to Notification message.
The PUSH I am sending via the server REST API has a promo code in it, but has nothing to do with my App really, so I dont want the Android App to open at all. I can't used the FCM Console to send the PUSH notification as each promo code is unique to the user and their pet, and there are thousands of them. I'm using the test http v1. api but the actual Android App has been built by someone else and I dont have access to the source code. What should I be looking out for ? Is the PUSH auto opening the App due to a call it makes and an intent in the app I can't change?
Thanks for any guidance.

Send message to a defined number of Android devices

I am creating an Android app for a local restaurant with Unity (for augmented reality), I want to send promo messages to only some Android devices where the app is installed (randomly or other way). I want to use a PHP/MySQL web page to do that.
With the push notification (Firebase for Android )
For notify multiple user, you can use a php server who send the notification action to firebase
https://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/

How to display messages in notification format like WhatsApp, when app is in background for chatting application on Android

I'm developing a chat application like WhatsApp. We are using our own API with our own database server for sending and receiving messages. It is working perfect.
Now, the receiver and the sender should get the notification alert whenever they receive messages from each other if their apps is not opened.
It became a big task to me to accomplish. I'm unable to get the notification alert. I tried to use Firebase, but still I don't understand, what are requirements I need to give (Tokens, Keys).
Please, let me know if I need to change any data in my server side and is there any possibility to integrate from my server to Firebase and if it is possible then what are the parameters I need to integrate/send.
maintain status of each user , like when app opens make them online and onDestroy() make update status to offline , if user is offline send both message and notification where as if user is online send only message....

Is it possible to send notification from one phone to another using firebase?

How can I send a notification directly from one android phone to another using firebase messaging?
(I don't have a separate backend server)

Categories

Resources