2

I just switched my app over to firebase 2.0 from parse. Basically I have an android app (main app) built for the general public to use. Then I also built a second app (manager app) that only I and a few others have access to which is used to update the content of the main app. Now I am adding in notifications which work fine when I send them from the firebase console, however, is it possible to send them from the manager app to the main app? If not, what would I need to do in order to send them from somewhere other than the console (I don't want anyone else to have access to the console but would like them to be able to send notifications.) Thanks!

Gabel
  • 149
  • 5
  • Are you trying to find the equivalent to Parse's Cloud Code, or just [sending upstream messages](https://firebase.google.com/docs/cloud-messaging/upstream#sample-send)? – OneCricketeer Aug 08 '16 at 21:31
  • Yes, you can send notifications via firebase REST API: http://stackoverflow.com/questions/37371990/how-can-i-send-a-firebase-cloud-messaging-notification-without-use-the-firebase – Héctor Aug 08 '16 at 21:31
  • Sending messages requires the user of your Server key, which should not be exposed in the APK that you give to your regular users. Since you say "manager app" that sounds like this might have a smaller distribution, in which case you could consider sending the HTTP request from the device: https://firebase.google.com/docs/cloud-messaging/downstream#sending_topic_messages_from_the_server. But tgis would be calling the FCM API. At the moment, Firebase Notifications does not have a public API. – Frank van Puffelen Aug 08 '16 at 21:45

1 Answers1

0

Seems like you are looking for device to device messaging. This is not currently supported by FCM, so you will need some type of server.

  • The server could implement XMPP in which case it can be a relay, upstream messages from admin client will be converted to downstream messages to non-admin clients.
  • The server could watch the Firebase Relatime Database and then the admin client could write something to the database and the server watching the database could then take action and send notifications to non-admin clients.
Arthur Thompson
  • 8,335
  • 3
  • 26
  • 31