notifiable-sender 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3d073a2ee72a393ec5b5eaa4dee362332f228a7
4
- data.tar.gz: c7ad0fae2823b9065a1905789218a527253c076d
3
+ metadata.gz: dfcdc6b0b4aed979ee52264e8639604bd7d45997
4
+ data.tar.gz: 6681509775bddfc5c29c15d30e3f570f8a086ba7
5
5
  SHA512:
6
- metadata.gz: b63ea1f2d45b4e8c6e5fe0d2f11ade66db6cd8b7cf48db460c0dc37547477b5807baae75a94cfc03e8dee3c72aab529126d536a2385effdd908aec4864b39ac7
7
- data.tar.gz: 50d4939019348e68c8a9504bf59d28f716152c2554d73bb1b0a8b633c473460d4f55f72df68fd2fedee657ed9496c1c12bd63ea43932f7f1379075b312d94c5c
6
+ metadata.gz: c5ba875db300b8733f3762b16f8cb5cb2bb4caf30078f7b1d3bffb4d3768f3a853fe1a8684b92a1de76b57ae561be212191e8e312b24c8640741a8e089a48425
7
+ data.tar.gz: f942404e89a248743aa678bec862592f63391748173382d601504731719f868608602eddafba6169e98f1106994691f3761e8f16c9dc4454fef69ce8b667dd41
@@ -12,31 +12,26 @@ module Notifiable
12
12
  @base_uri, @access_id, @secret_key, @logger = base_uri, access_id, secret_key, logger
13
13
  end
14
14
 
15
- def send_media_notification_to_users(user_aliases, media_url, title: nil, message: nil, parameters: {}, content_available: nil, thread_id:nil)
15
+ def send_media_notification_to_users(user_aliases, media_url, title: nil, message: nil, parameters: {}, content_available: nil, thread_id: nil, category: nil)
16
16
  raise 'user_aliases should be an array' unless user_aliases.is_a? Array
17
17
  raise 'media_url should not be blank' if media_url.nil? || media_url.empty?
18
18
 
19
19
  parameters = {media_url: media_url}.merge(parameters)
20
20
  filters = [{property: "user_alias", predicate: "in", value: user_aliases}]
21
- send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id, mutable_content: true)
21
+ send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id, mutable_content: true, category: category)
22
22
  end
23
23
 
24
- def send_notification_to_users(user_aliases, title: nil, message: nil, parameters: nil, content_available: nil, thread_id: nil, mutable_content: nil)
24
+ def send_notification_to_users(user_aliases, title: nil, message: nil, parameters: nil, content_available: nil, thread_id: nil, mutable_content: nil, category: nil)
25
25
  raise 'user_aliases should be an array' unless user_aliases.is_a? Array
26
26
 
27
27
  filters = [{property: "user_alias", predicate: "in", value: user_aliases}]
28
- send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id, mutable_content: mutable_content)
29
- end
30
-
31
- def send_notification_to_user(user_alias, title: nil, message: nil, parameters: nil, content_available: nil, thread_id: nil, mutable_content: nil)
32
- filters = [{property: "user_alias", predicate: "eq", value: user_alias}]
33
- send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id, mutable_content: mutable_content)
28
+ send_notification(title: title, message: message, parameters: parameters, content_available: content_available, filters: filters, thread_id: thread_id, mutable_content: mutable_content, category: category)
34
29
  end
35
30
 
36
31
  #
37
32
  # Params:
38
33
  # - filters: An array of hashes to filter notifications, e.g. [{property: "alert_level", predicate: "lt", value: 3}]
39
- def send_notification(title: nil, message: nil, parameters: nil, filters: nil, content_available: nil, thread_id: nil, mutable_content: nil)
34
+ def send_notification(title: nil, message: nil, parameters: nil, filters: nil, content_available: nil, thread_id: nil, mutable_content: nil, category: nil)
40
35
  body = {}
41
36
  body[:title] = title unless title.nil?
42
37
  body[:message] = message unless message.nil?
@@ -45,6 +40,7 @@ module Notifiable
45
40
  body[:content_available] = content_available unless content_available.nil?
46
41
  body[:thread_id] = thread_id unless thread_id.nil?
47
42
  body[:mutable_content] = mutable_content unless mutable_content.nil?
43
+ body[:category] = category unless category.nil?
48
44
 
49
45
  headers = {}
50
46
  headers[:authorization] = @access_id unless @secret_key
@@ -1,3 +1,3 @@
1
1
  module Notifiable
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notifiable-sender
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brooke-Smith