Skip to content
Greg Blake edited this page Mar 29, 2018 · 5 revisions

Android docs: Canonical IDs.

GCM under certain situations will require you to update your registration IDs. You must listen for these events and update your records accordingly. Rpush provides a reflection hook for you to implement:

Rpush.reflect do |on|
  # Called when the GCM returns a canonical registration ID.
  # You will need to replace old_id with canonical_id in your records.
  on.gcm_canonical_id do |old_id, canonical_id|
   # Example code if you have a Class 'Device' with an attribute 'registration_id':
   d = Device.find_by(registration_id: old_id)
   d.update_attributes(registration_id: canonical_id)
  end
end

See Reflection API for more information.

Clone this wiki locally
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy