dondeng / gcm_on_rails

Gcm on Rails (Google Cloud Messaging for Android on Rails)
MIT License
79 stars 48 forks source link

How to "touch" last_registered_at ? #14

Closed daniel-stockhausen closed 9 months ago

daniel-stockhausen commented 12 years ago

"In order for the Gcm::Feedback system to work properly you MUST touch the last_registered_at column every time someone opens your application. If you do not, then it is possible, and probably likely, that their device will be removed and will no longer receive notifications."

How can I do this, if the attribute is not accessible and the set_last_registered_at method is private?

Thanks, Daniel

wacaw commented 11 years ago

quick but not ideal solution is:

device = Gcm::Device.find_or_create_by_registration_id(params[:regId])
  device.last_registered_at = nil
  device.save