APNs' device tokens could expire and user should be able to capture errors from APNs:
class ApplicationNotifier < Fourseam::Base
rescue_from Fourseam::ApnDeliveryError do |error|
response = error.response
if response&.status == '410' || (response&.status == '400' && response&.body['reason'] == 'BadDeviceToken')
# delete device token accordingly
else
raise # Make sure to raise any other types of error to re-enqueue the job
end
end
end
APNs' device tokens could expire and user should be able to capture errors from APNs: