I am building a backend with Ruby (padrino framework) and would like to send push notification. I used this gem for push notification.
https://github.com/spacialdb/fcm
I used server key from firebase console could setting. This is code what I have used.
fcm = FCM.new(settings.fcm_serverkey)
registration_ids= [settings.test_key]
options = {data: {score: "123"}, collapse_key: "updated_score"}
response = fcm.send(registration_ids, options)
And this is error what I got.
{:body=>"{\"multicast_id\":8815634661444747749,\"success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"MismatchSenderId\"}]}", :headers=>{"content-type"=>["application/json; charset=UTF-8"], "date"=>["Wed, 20 Dec 2017 21:05:04 GMT"], "expires"=>["Wed, 20 Dec 2017 21:05:04 GMT"], "cache-control"=>["private, max-age=0"], "x-content-type-options"=>["nosniff"], "x-frame-options"=>["SAMEORIGIN"], "x-xss-protection"=>["1; mode=block"], "server"=>["GSE"], "alt-svc"=>["hq=\":443\"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=\":443\"; ma=2592000; v=\"41,39,38,37,35\""], "accept-ranges"=>["none"], "vary"=>["Accept-Encoding"], "connection"=>["close"]}, :status_code=>200, :response=>"success", :canonical_ids=>[], :not_registered_ids=>[]}
What the important thing is "MismatchSenderId" from error log. I can't find param for senderID in github guide. They only mentioned about serverkey. Any advice will be big help for me. Thanks