action_native_push 0.1.0 → 0.1.1
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/README.md +12 -15
- data/lib/action_native_push/version.rb +1 -1
- metadata +9 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a75fba0494a552ca71a3fe1294bf4455123c90ff560ed0d125e05fdfc39c6f99
|
4
|
+
data.tar.gz: 170be5a76f7bd8017d5e14ca2bccaad0e5b54ee00670d8ccf3d92ee0875f2b5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b0e3cfa43a1908ea04dac13e0244aa84f557c2f0c91e6303ecc86204c9d1638784378f1bef5f196e684fcfe179b8c151754a020642c68f7bf712cebfe697f17
|
7
|
+
data.tar.gz: 19d2a3f25123fbe5b2f40efd36f83a5f9a6fe55894e438b99f972ec3a587670bc503fc87614a247c9db19c656822470e3943c92eb04d68a64a6e4dff94e37dfc
|
data/README.md
CHANGED
@@ -173,7 +173,7 @@ device = ApplicationPushDevice.create! \
|
|
173
173
|
|
174
174
|
notification = ApplicationPushNotification.new \
|
175
175
|
title: "Hello world!",
|
176
|
-
body: "Welcome to Action Native Push"
|
176
|
+
body: "Welcome to Action Native Push"
|
177
177
|
|
178
178
|
notification.deliver_later_to(device)
|
179
179
|
```
|
@@ -211,13 +211,10 @@ need to send additional data that is specific to the platform you are using.
|
|
211
211
|
You can use `with_apple` for Apple and `with_google` for Google:
|
212
212
|
|
213
213
|
```ruby
|
214
|
-
|
214
|
+
notification = ApplicationPushNotification
|
215
215
|
.with_apple(category: "observable")
|
216
|
-
.
|
217
|
-
|
218
|
-
google_notification = ApplicationPushNotification
|
219
|
-
.with_google({ data: { badge: 1 } })
|
220
|
-
.new(title: "Hi Google")
|
216
|
+
.with_google(data: { badge: 1 })
|
217
|
+
.new(title: "Hello world!")
|
221
218
|
```
|
222
219
|
|
223
220
|
The platform payload takes precedence over the other fields, and you can use it to override the
|
@@ -225,7 +222,7 @@ default behaviour:
|
|
225
222
|
|
226
223
|
```ruby
|
227
224
|
notification = ApplicationPushNotification
|
228
|
-
.with_google(
|
225
|
+
.with_google(android: { notification: { notification_count: nil } })
|
229
226
|
.new(title: "Hello world!", body: "Welcome to Action Native Push", badge: 1)
|
230
227
|
```
|
231
228
|
|
@@ -237,7 +234,7 @@ and `body`.
|
|
237
234
|
You can create a silent notification via the `silent` method:
|
238
235
|
|
239
236
|
```ruby
|
240
|
-
notification = ApplicationPushNotification.silent.with_data(
|
237
|
+
notification = ApplicationPushNotification.silent.with_data(id: 1)
|
241
238
|
```
|
242
239
|
|
243
240
|
This will create a silent notification for both Apple and Google platforms and sets an application
|
@@ -274,9 +271,9 @@ by adding extra arguments to the notification constructor:
|
|
274
271
|
data = { calendar_id: @calendar.id, identity_id: @identity.id }
|
275
272
|
|
276
273
|
notification = CalendarPushNotification
|
277
|
-
.with_apple(
|
278
|
-
.with_google(
|
279
|
-
.new(
|
274
|
+
.with_apple(custom_payload: data)
|
275
|
+
.with_google(data: data)
|
276
|
+
.new(calendar_id: 123)
|
280
277
|
|
281
278
|
notification.deliver_later_to(device)
|
282
279
|
```
|
@@ -309,12 +306,12 @@ end
|
|
309
306
|
|------------------|------------
|
310
307
|
| :title | The title of the notification.
|
311
308
|
| :body | The body of the notification.
|
312
|
-
| :badge | The badge number to display on the app icon
|
309
|
+
| :badge | The badge number to display on the app icon.
|
313
310
|
| :thread_id | The thread identifier for grouping notifications.
|
314
311
|
| :sound | The sound to play when the notification is received.
|
315
312
|
| :high_priority | Whether the notification should be sent with high priority (default: true).
|
316
|
-
| :google_data | The
|
317
|
-
| :apple_data | The
|
313
|
+
| :google_data | The Google-specific payload for the notification.
|
314
|
+
| :apple_data | The Apple-specific payload for the notification.
|
318
315
|
| :data | The data payload for the notification, sent to all platforms.
|
319
316
|
| ** | Any additional attributes passed to the constructor will be merged in the `context` hash.
|
320
317
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_native_push
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacopo Beschi
|
@@ -125,6 +125,13 @@ licenses:
|
|
125
125
|
metadata:
|
126
126
|
homepage_uri: https://github.com/basecamp/action_native_push
|
127
127
|
source_code_uri: https://github.com/basecamp/action_native_push
|
128
|
+
post_install_message: |2+
|
129
|
+
|
130
|
+
DEPRECATION WARNING:
|
131
|
+
! The "action_native_push" gem has been renamed to "action_push_native".
|
132
|
+
! See: https://rubygems.org/gems/action_push_native
|
133
|
+
! And: https://github.com/rails/action_push_native
|
134
|
+
|
128
135
|
rdoc_options: []
|
129
136
|
require_paths:
|
130
137
|
- lib
|
@@ -143,3 +150,4 @@ rubygems_version: 3.6.9
|
|
143
150
|
specification_version: 4
|
144
151
|
summary: Send push notifications to mobile apps
|
145
152
|
test_files: []
|
153
|
+
...
|