Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APNS feedback #48

Closed
iOSDevil opened this issue Jul 15, 2014 · 3 comments
Closed

APNS feedback #48

iOSDevil opened this issue Jul 15, 2014 · 3 comments
Milestone

Comments

@iOSDevil
Copy link

Hi,

I'm using the reflection API to remove device tokens from my database, the intention is to respond to iOS app uninstalls or users disabling push.

However, it would appear that the method that I'm using is causing device tokens to be deleted if an APNS is not delivered regardless of the reason.

Below is the only method that I'm overriding in config/initializers/rpush.rb:

Called with a Rpush::Apns::Feedback instance when feedback is received

from the APNs that a notification has failed to be delivered.

Further notifications should not be sent to the device.

on.apns_feedback do |feedback|
d=Pushreg.find_by_devicetoken(feedback.device_token)
[*d].each do |registrationtodelete|
registrationtodelete.delete
registrationtodelete.save
end

end

@ileitch
Copy link
Member

ileitch commented Jul 16, 2014

You can see all past feedback by selecting from Rpush::Apns::Feedback. Do you see a record for every device token?

You don't need to call save after delete.

Are you sure find_by_devicetoken is returning on the record you intend?

@ileitch ileitch added this to the 2.0.0 milestone Jul 20, 2014
@ileitch
Copy link
Member

ileitch commented Sep 7, 2014

any updates?

@ileitch ileitch closed this as completed Oct 5, 2014
@pdaire
Copy link

pdaire commented Jul 13, 2015

@ileitch is this query incremental or it fetches always all the feedback records? Are we responsible of clearing the table once devices were removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants