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
@@ -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|------------------|------------
0 commit comments