4

I am working on an android app where I want to be able to use the notification system within Firebase. I want to use the advanced features where I can add key/value pairs so that I can implement the notifications to do different things under certain conditions when clicked.

I obviously only want to test this on my test/development devices but can't see a way to do this.

vitr
  • 6,766
  • 8
  • 30
  • 50
Boardy
  • 35,417
  • 104
  • 256
  • 447
  • When you say advanced features (key/value) pairs you refer to send the notification from your own server implementation? or what exactly do you need? – GeorgeLBA Aug 23 '16 at 10:55
  • @GeorgeLBA No under the firebase console menu there is Notifications. From there you can enter a message and when to deliver, then you can expand Advanced and provide custom data in key/value pair format, it also includes other stuff such as expiry and priority etc – Boardy Aug 23 '16 at 11:37
  • This is full totorial Sending Push Notifications to Android with Firebase https://www.codementor.io/android/tutorial/send-push-notifications-to-android-with-firebase – Tai Nguyen Aug 23 '16 at 12:01

3 Answers3

2

You should choose single device choice on "send notification" screen. enter image description here

After that you should get your FCM registration token. Yo can get token via this app. https://play.google.com/store/apps/details?id=com.tune.mytunedevice

Write your token and send notification.

Cüneyt
  • 2,565
  • 25
  • 31
1

You could create a new product flavor for your app (e.g. "development") (Configure Build Variants) and create a seperate firebase project (with a seperate google-services.json file) (Add multiple google-services.json files).

Then you have different API keys for each project which don't effect each other.

Community
  • 1
  • 1
tobifasc
  • 681
  • 5
  • 17
  • 1
    Sorry for the delay, got tied up with something else. This did the trick, thanks for your help – Boardy Sep 02 '16 at 16:25
1

You can get the FCM registration ID for those testing devices and send the message just for them, or create a topic/testing and register those devices to that topic then send the message just for this topic.

Albert
  • 324
  • 1
  • 4
  • 20