moromi-aws-sns 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/moromi/aws/sns/message/fcm.rb +15 -3
- data/lib/moromi/aws/sns/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58088388b1d00086e4b0505c5ded7b974cf661c3
|
4
|
+
data.tar.gz: ff9025ba2034cd7e758ac61553014551d24e4bab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 549c0c4f8038b9adbb65b88a811d0528d236befec3a9aae0ef69654eb7aa77fe5d38628742b639f5cc57e7cb3e44b26a9345fc571f1091cb4b7259efd1173693
|
7
|
+
data.tar.gz: f337eb459813397ff54b87c7e26c5cfc7599bf8f5a783958f6dd33a1786de85d98cdfa0bc874152b514f2fd7660355b278ee9244f62dabaaa2547aae35d1e780
|
@@ -58,7 +58,7 @@ module Moromi
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def to_data_hash
|
61
|
-
{
|
61
|
+
base = {
|
62
62
|
title: @title,
|
63
63
|
body: @body,
|
64
64
|
android_channel_id: @android_channel_id,
|
@@ -71,9 +71,9 @@ module Moromi
|
|
71
71
|
body_loc_args: @body_loc_args,
|
72
72
|
title_loc_key: @title_loc_key,
|
73
73
|
title_loc_args: @title_loc_args,
|
74
|
-
type: @type
|
75
|
-
custom_data: @custom_data.to_json
|
74
|
+
type: @type
|
76
75
|
}
|
76
|
+
flatten_hash(@custom_data).merge(base)
|
77
77
|
end
|
78
78
|
|
79
79
|
def to_message_json
|
@@ -85,6 +85,18 @@ module Moromi
|
|
85
85
|
def setup_initial_custom_data(custom_data)
|
86
86
|
custom_data
|
87
87
|
end
|
88
|
+
|
89
|
+
def flatten_hash(hash)
|
90
|
+
hash.each_with_object({}) do |(k, v), h|
|
91
|
+
if v.is_a? Hash
|
92
|
+
flatten_hash(v).map do |h_k, h_v|
|
93
|
+
h["#{k}_#{h_k}".to_sym] = h_v
|
94
|
+
end
|
95
|
+
else
|
96
|
+
h[k] = v
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
88
100
|
end
|
89
101
|
end
|
90
102
|
end
|