0

I was unable to find anything in the FCM documentation that answers my question -- the documentation doesn't explicitly say either way. My question is:

Can I create and send a topic message to FCM from an iOS or Android client?

What I'd like to do is have the client create a topic message, and have FCM send notifications to all subscribers of that topic. I was hoping to accomplish this without creating an actual FCM server.

Thanks!

EDIT: I don't think I was clear in my original question. I know how to subscribe to a topic, and I'm well aware that when I subscribe to a topic, that topic will be created if it doesn't already exist.

I want to send a message to a topic from a client. I'm looking for functionality along the lines as

FIRMessaging.messaging().send(toTopic: "/topics/example")

I'm asking if such functionality exists.

cohenadair
  • 2,072
  • 1
  • 22
  • 38
  • Topics are automatically created when your either subscribe to them or send a message to them. It may take a few hours before new topics show up in the Firebase Notifications console, but you can already send messages to them before that. See http://stackoverflow.com/questions/40264202/how-create-notification-topic-for-firebase-and-use-this – Frank van Puffelen Dec 28 '16 at 21:20
  • I updated my question to be a little clearer. – cohenadair Dec 28 '16 at 21:25
  • 1
    There is no way to send messages directly from a device to other devices. See http://stackoverflow.com/questions/37634046/is-it-possible-to-send-pushnotifications-using-firebase-cloud-messaging-fcm-t (for iOS, but it applies to all SDKs). – Frank van Puffelen Dec 28 '16 at 21:31
  • Ah, that's unfortunate. Thank you for referencing the other answer; I was unable to find it earlier. – cohenadair Dec 29 '16 at 13:43

0 Answers0