0
votes

I am using gcm gem for sending android push notification from rails app.The error I am getting from rails console is

{:body=>"{\"multicast_id\":5375003398127853487,\"success\":0,\"failure\":1,\"canonical_ids\":0,\"results\":[{\"error\":\"MismatchSenderId\"}]}", :headers=>{"content-type"=>["application/json; charset=UTF-8"], "date"=>["Mon, 07 Mar 2016 12:47:23 GMT"], "expires"=>["Mon, 07 Mar 2016 12:47:23 GMT"], "cache-control"=>["private, max-age=0"], "x-content-type-options"=>["nosniff"], "x-frame-options"=>["SAMEORIGIN"], "x-xss-protection"=>["1; mode=block"], "server"=>["GSE"], "alternate-protocol"=>["443:quic,p=1"], "alt-svc"=>["quic=\":443\"; ma=2592000; v=\"30,29,28,27,26,25\""], "accept-ranges"=>["none"], "vary"=>["Accept-Encoding"], "connection"=>["close"]}, :status_code=>200, :response=>"success", :canonical_ids=>[], :not_registered_ids=>[]}

please help me to figure out

1
I have found that the registration id I was using previously was incorrect .After I have put the correct id I am getting the response as success but no push is coming into the android device. - Luna Das
{\"multicast_id\":5378715674590080992,\"success\":1,\"failure\":0,\"canonical_ids\":0,\"results\":[{\"message_id\":\"0:1457360447424574%473c9dc2f9fd7ecd\"}]}" I am getting this response though the push is not coming to the android. - Luna Das

1 Answers

2
votes

Make sure the following is met:

  1. The JSON file you downloaded from Google Developer site is placed in /app directory
  2. The registration service started and returned a non-null value for registration key
  3. The listener service is setup correctly, and the onMessageReceived method is setup as desired, so that the notification will be created and shown.

The sample project supplied by Google actually gives the minimal setup requirements for the notification to work properly. Refer Here