lib/urbanairship.rb in urbanairship-2.1.1 vs lib/urbanairship.rb in urbanairship-2.1.2
- old
+ new
@@ -24,11 +24,15 @@
else
do_request(:put, "/api/device_tokens/#{device_token}", :body => body, :authenticate_with => :application_secret)
end
end
- def unregister_device(device_token)
- do_request(:delete, "/api/device_tokens/#{device_token}", :authenticate_with => :application_secret)
+ def unregister_device(device_token, options = {})
+ if (options[:provider] || @provider) == :android
+ do_request(:delete, "/api/apids/#{device_token}", :authenticate_with => :application_secret)
+ else
+ do_request(:delete, "/api/device_tokens/#{device_token}", :authenticate_with => :application_secret)
+ end
end
def delete_scheduled_push(param)
path = param.is_a?(Hash) ? "/api/push/scheduled/alias/#{param[:alias].to_s}" : "/api/push/scheduled/#{param.to_s}"
do_request(:delete, path, :authenticate_with => :master_secret)