I trying to understand how FCM (Push notifications) works... and that is very differ with Web applications...
What I did →
- Register new project in Firebase
- Added App
com.google.firebase.quickstart.fcm
and downloadgoogle-services.json
- Built App using
google-services.json
in Android Studio - Install APK on my device
- Go to
https://console.firebase.google.com/project/{PROJECT_NAME}/notification
and sent new notification - And... nothing happens
So my questions are
- As I know here is two ways to send notification: a) use device token and send direct notification, b) subscribe device to topic at client side.
But
a) When I try to createNew notification
in firebase console, here is no field where I will be able to insert device token. Here isTarget → Target user if → App → com.google.firebase.quickstart.fcm
. So do I need to know device token or I can send notifications to all clients that have my app installed on their devices?
b) When I trying to send message onweather
topic nothing happens. Even if I pressed buttonSubscribe to weather
(In manual you may findSubscribe to News
, but actual version button isweather
) - Is there any way to check (especially at server side) if my device registered in FCM or not?
- What is the most effective way send same contents on big number of devices (for example 50000) with minimum time lag? Try to loop over device tokens (1000 tokens per request) or using topics? Is there any other ways?
- Actually my backend is AWS SNS in pair with FCM, so if you can answer about most effective way in case of SNS + FCM that will be brilliant
- I don't know... any suggestions? I'm a web developer (REST, etc...) and have zero experience with mobile apps