lib/j7w1/sns_push_client.rb in j7w1-0.0.20 vs lib/j7w1/sns_push_client.rb in j7w1-0.0.21
- old
+ new
@@ -46,23 +46,21 @@
client.client.delete_platform_application(platform_application_arn: arn)
end
def create_device_endpoint(device_identifier, platform, options = {})
custom_user_data = options[:custom_user_data]
- sns_configuration = options[:sns_configuration]
+ sns_configuration = options[:sns_configuration] || J7W1.configuration
sns_client = options[:sns_client]
- sns_client ||= create_sns_client(sns_configuration || J7W1.configuration)
+ sns_client ||= create_sns_client(sns_configuration)
- sns_config = J7W1.configuration
-
app_arn =
case platform
when :ios
- sns_config.ios_endpoint.arn
+ sns_configuration.ios_endpoint.arn
when :android
- sns_config.android_endpoint.arn
+ sns_configuration.android_endpoint.arn
else
end
endpoint =
@@ -165,8 +163,9 @@
argument
end
end
module_function :create_sns_client, :create_ios_application, :create_device_endpoint, :push,
- :payload_for, :ios_payload_for, :android_payload_for, :content_from, :message_content_with_table
+ :payload_for, :ios_payload_for, :android_payload_for, :content_from, :message_content_with_table,
+ :destroy_device_endpoint, :destroy_application_endpoint
end
end