1- # Action Native Push
1+ # Action Push Native
22
3- Action Native Push is a Rails push notification gem for mobile platforms, supporting APNs (Apple) and FCM (Google).
3+ Action Push Native is a Rails push notification gem for mobile platforms, supporting APNs (Apple) and FCM (Google).
44
55## Installation
66
77``` bash
8- 1. bundle add action_native_push
9- 2. bin/rails g action_native_push :install
10- 3. bin/rails action_native_push :install:migrations
8+ 1. bundle add action_push_native
9+ 2. bin/rails g action_push_native :install
10+ 3. bin/rails action_push_native :install:migrations
11114. bin/rails db:migrate
1212```
1313
@@ -25,7 +25,7 @@ The installation will create:
2525` app/models/application_push_notification.rb ` :
2626
2727``` ruby
28- class ApplicationPushNotification < ActionNativePush ::Notification
28+ class ApplicationPushNotification < ActionPushNative ::Notification
2929 # Set a custom job queue_name
3030 queue_as :realtime
3131
@@ -45,7 +45,7 @@ you can change the application defaults by editing it directly.
4545` app/jobs/application_push_notification_job.rb ` :
4646
4747``` ruby
48- class ApplicationPushNotificationJob < ActionNativePush ::NotificationJob
48+ class ApplicationPushNotificationJob < ActionPushNative ::NotificationJob
4949 # Enable logging job arguments (default: false)
5050 self .log_arguments = true
5151
@@ -60,9 +60,9 @@ directly in your application.
6060` app/models/application_push_device.rb ` :
6161
6262``` ruby
63- class ApplicationPushDevice < ActionNativePush ::Device
63+ class ApplicationPushDevice < ActionPushNative ::Device
6464 # Customize TokenError handling (default: destroy!)
65- # rescue_from (ActionNativePush ::TokenError) { Rails.logger.error("Device #{id} token is invalid") }
65+ # rescue_from (ActionPushNative ::TokenError) { Rails.logger.error("Device #{id} token is invalid") }
6666end
6767```
6868
@@ -173,7 +173,7 @@ device = ApplicationPushDevice.create! \
173173
174174notification = ApplicationPushNotification.new \
175175 title: "Hello world!",
176- body: "Welcome to Action Native Push"
176+ body: "Welcome to Action Push Native "
177177
178178notification.deliver_later_to(device)
179179` ` `
@@ -200,7 +200,7 @@ You can pass custom data to the application using the `with_data` method:
200200` ` ` ruby
201201notification = ApplicationPushNotification
202202 .with_data({ badge: "1" })
203- .new(title: "Welcome to Action Native Push")
203+ .new(title: "Welcome to Action Push Native ")
204204` ` `
205205
206206# ## Custom platform Payload
@@ -223,7 +223,7 @@ default behaviour:
223223` ` ` ruby
224224notification = ApplicationPushNotification
225225 .with_google(android: { notification: { notification_count: nil } })
226- .new(title: "Hello world!", body: "Welcome to Action Native Push", badge: 1)
226+ .new(title: "Hello world!", body: "Welcome to Action Push Native ", badge: 1)
227227` ` `
228228
229229This will unset the default `notification_count` (`badge`) field in the Google payload, while keeping `title`
@@ -293,14 +293,14 @@ class CustomDevice
293293
294294 def push(notification)
295295 notification.token = token
296- ActionNativePush .service_for(platform, notification).push(notification)
297- rescue ActionNativePush ::TokenError => error
296+ ActionPushNative .service_for(platform, notification).push(notification)
297+ rescue ActionPushNative ::TokenError => error
298298 # Custom token error handling
299299 end
300300end
301301` ` `
302302
303- # # `ActionNativePush ::Notification` attributes
303+ # # `ActionPushNative ::Notification` attributes
304304
305305| Name | Description
306306|------------------|------------
326326
327327# # License
328328
329- Action Native Push is licensed under MIT.
329+ Action Push Native is licensed under MIT.
0 commit comments