Send Apple and Android push notifications with Action Push Native
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-
devicesShould return a list of
ApplicationPushDevicerecords -
formatShould return a
Hashof Notification attributes -
with_dataShould return a
Hashof custom data to be sent with the notification to all platforms. -
with_appleShould return a
Hashof APNs specific data -
with_googleShould return a
Hashof FCM specific data -
silentShould return a
Booleanif notification should be silent