Pigeon Multiple FCM keys

Hi all,

I am using Pigeon library to manage mobile push notifications until now I’ve only had the need of having one fcm/apns key in config like shown below, I am looking to add a second key for fcm how would that be possible. I have looked around not seen anything clear on this scenario.

config :pigeon,
       :apns,
       apns_default: %{
         cert: System.get_env("APNS_CERT"),
         key: System.get_env("APNS_KEY"),
         mode: :dev
       }
config :pigeon,
       :fcm,
       fcm_default: %{
         key: System.get_env("FCM_KEY")
       },

Any help/suggestion is welcome.

Many thanks in advance.

Does this answers to your question?

2 Likes

Hey. Can you tell me what is registration id when you’re sending the message like this

 msg = %{"body" => "your message"}
 n = Pigeon.FCM.Notification.new("your device registration ID", msg)

Is it the same as sender id ?

Hi,

The registration ID is the token created by the device, i.e the receiving device.

How do I get that token? I’m connected to real android device

Your android app should send the token to the server for storage. Once stored you can use it to send notifications to device.
https://firebase.google.com/docs/cloud-messaging/android/first-message

1 Like

This isn’t generated on elixir app, its on your android app.

check this guide: http://lessons.livecode.com/m/4069/l/59312-how-do-i-use-push-notifications-with-android

1 Like

Yeah I solved it. I didn’t know this concept. Just read it.

I was using flutter so here it’s given how you can send the token

I believe it would be more appropriate to post for help on a flutter forum.