0

I am using Google's Firebase to manage some of the back end aspects of my mobile application.

Mainly I am using it for authentication with email as well as sending push notifications.

Currently, I have around 10 users who have been registered for a push notification token.

My question is that, I want to send a notification to only 8 users. Is this possible, because I can't seem to find a location where I can select the users.

I tried disabling the users from the Authentication tab but that seems not to make it work as authenticated users and Push-registered users seem to be different.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
tony9099
  • 4,567
  • 9
  • 44
  • 73
  • You need to target the specific users using their registration tokens or if they have a common topic. – AL. Jan 24 '18 at 09:30

1 Answers1

1

You can target FCM messages:

  • To the iOS or Android app that is being used (through the Console only).
  • To an Analytics audience that the user of the app is part of (through the Console only).
  • To a topic the app instance is subscribed to (through the Console and the API).
  • To a group of devices, if you know their group ID (through the Console and the API).
  • To a specific device instance (i.e. a specific app on a specific phone) if you know their instance ID token (through the Console and the API).

There is no way in the Firebase console to select the users to send a message to. In fact: Firebase Cloud Messaging has no concept of a user, all it knows is the token that identifies the app that it's part of on the device that it's installed on.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Regarding the tokens, I have them on my external database and I know them. Can I send them to a group of the tokens? My problem is, I can't see where they are stored in the console to group them or create audiences. – tony9099 Jan 25 '18 at 15:49
  • Audiences are based on Analytics data, you can't create them yourself. Device groups are an option, but only for a small number of tokens. They're essentially meant to be something like "all devices from one user". But you can specify multiple tokens when you send a message, so that should work. – Frank van Puffelen Jan 25 '18 at 16:13
  • Ok @Frank, I'll try that and revert in case I need anything. Thanks a lot for your contribution. Appreciate it. – tony9099 Jan 25 '18 at 16:18