Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added additional check in sound notification sending

  • Loading branch information...
commit 442878eed42a63a9a293b599cb6504fe83d3b257 1 parent c79bb53
@ramigg authored
View
2  lib/apn_on_rails/app/models/apn/group_notification.rb
@@ -45,7 +45,7 @@ def apple_hash
result['aps']['alert'] = self.alert if self.alert
result['aps']['badge'] = self.badge.to_i if self.badge
if self.sound
- result['aps']['sound'] = self.sound if self.sound.is_a? String
+ result['aps']['sound'] = self.sound if self.sound.is_a?(String) && self.sound.strip.present?
result['aps']['sound'] = "1.aiff" if self.sound.is_a?(TrueClass)
end
if self.custom_properties
View
2  lib/apn_on_rails/app/models/apn/notification.rb
@@ -54,7 +54,7 @@ def apple_hash
result['aps']['alert'] = self.alert if self.alert
result['aps']['badge'] = self.badge.to_i if self.badge
if self.sound
- result['aps']['sound'] = self.sound if self.sound.is_a? String
+ result['aps']['sound'] = self.sound if self.sound.is_a?(String) && self.sound.strip.present?
result['aps']['sound'] = "1.aiff" if self.sound.is_a?(TrueClass)
end
if self.custom_properties
Please sign in to comment.
Something went wrong with that request. Please try again.