gcm icon indicating copy to clipboard operation
gcm copied to clipboard

How to handel canonical registration ID's ?

Open UsmanMalik opened this issue 9 years ago • 3 comments

There is no documentation i found on how i can remove/replace canonical registration ids. can you please help?

UsmanMalik avatar Jun 20 '15 20:06 UsmanMalik

@UsmanMalik, it's not documented, I'm using this:

if response[:response] == 'success'
  if response[:canonical_ids]
    response[:canonical_ids].each do |id|
      device = Device.find_by!(registration_id: id[:old])
      device.update_attribute(:registration_id, id[:new])
    end
  end

  response
else
  raise ResponseError, response[:response]
end

amenzhinsky avatar Aug 20 '15 13:08 amenzhinsky

thanks @amenzhinsky :clap:

kashif avatar Aug 20 '15 17:08 kashif

Thanks, i will try and let you know.

UsmanMalik avatar Aug 21 '15 10:08 UsmanMalik