Hello, Caio!
1 - About your question code example:
mNotificationManager.notify(id, mBuilder.build());
the id
which you refer to is just an internal identifier for if you want to update your notification at another time. Such notification is a resource made available by SDK
of Android
.
2 - If you want your app to be able to receive messages directly from the server (such as friend requests, likes, etc.), you can use Firebase Cloud Messaging (FCM), for example.
3 - When you set up your app to finally receive messages from WCF, you can use the API
native to the Android
notification (cited above) to show the user that an event has occurred.
Access https://firebase.google.com/docs/cloud-messaging/? hl=en and see how to set up your app.
I hope it helps you!
I would like when the user (x) made a transaction that saved to the database, take the entered data and send a notification to the user (y). The idea is to make a leisure area rental app, when the user(x) buys the daily rate of the area the user(y) would be notified.
– Caio Cavallari
@Caiocavallari, for this you will need to use the Cloud Functions and trigger event in the
database
– Ivan Silva