lib/urbanairship/devices/channel_uninstall.rb in urbanairship-5.9.0 vs lib/urbanairship/devices/channel_uninstall.rb in urbanairship-6.0.0

- old
+ new

@@ -21,43 +21,43 @@ 'Maximum of 200 channel uninstalls exceeded.' if chan_num > 200 response = @client.send_request( method: 'POST', body: JSON.dump(channels), - url: CHANNEL_URL + 'uninstall/', + url: channel_url('uninstall/'), content_type: 'application/json' ) logger.info { "Successfully uninstalled #{chan_num} channels." } response end end - - + + class OpenChannelUninstall include Urbanairship::Common include Urbanairship::Loggable attr_reader :client - + def initialize(client: required('client')) @client = client end - + def uninstall(address: required('address'), open_platform: required('open_platform')) - + body = { address: address, open_platform_name: open_platform } - + response = @client.send_request( method: 'POST', body: JSON.dump(body), - url: OPEN_CHANNEL_URL + 'uninstall/', + url: open_channel_url('uninstall/'), content_type: 'application/json' ) - + logger.info { "Successfully uninstalled open channel with address: #{address}"} response end end end