Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 1.24 KB

File metadata and controls

55 lines (39 loc) · 1.24 KB

Action Push Native Notification Delivery Method

Send Apple and Android push notifications with Action Push Native

Usage

class CommentNotifier < ApplicationNotifier
  deliver_by :action_push_native do |config|
    config.devices = -> { ApplicationPushDevice.where(owner: recipient) }
    config.format = -> {
      {
        title: "Hello world, #{recipient.first_name}!",
        body: "Welcome to Noticed with Action Push Native.",
        badge: 1,
      }
    }
    config.with_apple = -> {
      { category: "observable" }
    }
    config.with_google = -> {
      { }
    }
    config.with_data = -> {
      { }
    }
  end
end

Options

  • devices

    Should return a list of ApplicationPushDevice records

  • format

    Should return a Hash of Notification attributes

  • with_data

    Should return a Hash of custom data to be sent with the notification to all platforms.

  • with_apple

    Should return a Hash of APNs specific data

  • with_google

    Should return a Hash of FCM specific data

  • silent

    Should return a Boolean if notification should be silent