0

We have a project with three build variants: dev, tst, live and respective package names our.package.name.dev, our.package.name.tst, our.package.name. All build variants have different back-ends so we need to display different push notifications for different variants.

The Server API key in the developers console is not connected with any certain build variant/package name, so it sends out to all build flavours.

Is there a designated way to approach this problem? The only solution I currently see, is to send the target build variant with the GCM data and check in the front-end.

Mark K.
  • 17
  • 4
  • When you manually registered with GCM, to get an `sender id` (12 digit number) and an `API key` (39 char alphanumeric), did you provide your `package name` then? That's what I got asked for, which indicated I needed to use the right identifier in the future. – Magnus Smith Feb 10 '16 at 21:23

1 Answers1

1

You can use an option restricted_package_name. This parameter specifies the package name of the application where the registration tokens must match in order to receive the message.

gerardnimo
  • 1,444
  • 8
  • 10