Is it possible to get the app instances subscribe on a topic with GCM - google-cloud-messaging

Does an API exist to get the APP instances who are in a topic ?

On Role of the Application Server, there is no service for getting registration ids which are registered to GCM or registered in a topic.
So you have to implement your own server and record registration_ids and topics in a database.

Related

firebase admin is only available for admin or users also to send notification to other users?

Firebase admin is only available for admin or users also to send notification to other users?
Actually i am little bit confused in send notification from one user to another and which data is used like on the basis of user receiver uid or receiver fcm token.
firebaser here
Calls to the FCM API to send messages require that you specify the FCM server key in your code. As its name implies, this key should only be used in server-side code, or in an otherwise trusted environment. The reason for this is that anyone who has the FCM server key can send whatever message they want to all of your users.
So sending messages to users is indeed only possible from a trusted environment, either through the Admin SDK, or the REST APIs. See How to send one to one message using Firebase Messaging for more.

Is Firebase Cloud Messaging authentication necessary?

I have server in php with custom user authentication. I'm trying to create chat with Firebase, and after reading docs I'm still confused id I need to authenticate my users for Firebase, and if so should I do it with signInWithCustomToken?
Any other tips on how should I proceed are welcome. Thank you.
There is no need to authenticate users for them to receive FCM messages.
You do need to pass the FCM Server key to send messages to devices however. You can see an example of that in the Authorization header here: https://firebase.google.com/docs/cloud-messaging/send-message

Sending Push Notification To All People Who Have Enabled Notifications For My Progressive Web App

I am in the process of developing a new site and have decided to add progressive web app capabilities to the site. I have set it all up correctly and I can send push notifications to devices with whom I know the endpoint via FCM with a cURL command.
My question is how do you send one to all users who have enabled notifications on my site without knowing a list of all users unique endpoints.
If you are using the Firebase Cloud Messaging Web SDK you should be able to get the Firebase token and subscribe that token a topic using the server side API and then you can message the topic.
NOTE: This requires the use of the Firebase Web SDK to work. This is not supported with the raw Web Push API.

One XMPP connection for more than one GCM/FCM app

I have a bunch of FCM projects and I'd like to use the same XMPP connection to send messages for all those projects. The FCM docs say that each connection needs to authenticate with the app id and server key, meaning I can use one XMPP connection for one project only. Is there any way around this?
I'm not sure what the question is here. Just use the corresponding Sender ID and Server Key from your Firebase Project. However, do note of the connection limitation mentioned in the docs you linked:
For each sender ID, FCM allows 1000 connections in parallel.
I don't really see any issue here, so long as you're using the same Firebase Project for FCM on all of your apps, you're good to go.
Unfortunately, if you have multiple projects, the only workaround I can only see that you can do is for you to use only a single project for your FCM processes.

Google Cloud Messaging token

I'd like to know if each time my application runs I need to get the token and pass it to the server, or if it's only necessary once to register the application. Thanks a lot.
You need a token to register the GCM(push notification) to the Google Server. Then this token is passed and used in the server to send subsequent notification. This token should be persisted by the server so that it can be used to make API calls to the Google server. With this approach, your server and the Android device do not need to create a persistent connection and the responsibility of queuing and relaying messages is all handled by Google's servers.
For more information visit the Registering Client Apps and also check this documentation.