Skip to content

Add Action Push Native delivery method - #555

Merged
excid3 merged 8 commits into
mainfrom
action-push-native
Oct 3, 2025
Merged

Add Action Push Native delivery method#555
excid3 merged 8 commits into
mainfrom
action-push-native

Conversation

@excid3

@excid3 excid3 commented Sep 17, 2025

Copy link
Copy Markdown
Owner

This adds support for Action Push Native as a delivery method.

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.apple_data = -> {
      { category: "observable" }
    }
    config.google_data = -> {
      { }
    }
    config.with_data = -> {
      { }
    }
  end
end

It also adds a deprecation notice to iOS and FCM delivery methods which are replaced by Action Web Push.

@excid3 excid3 self-assigned this Sep 17, 2025
@excid3 excid3 added the enhancement New feature or request label Sep 17, 2025
@jcmaciel

jcmaciel commented Sep 29, 2025

Copy link
Copy Markdown

@excid3 hey, when will merge it?

@excid3

excid3 commented Sep 29, 2025

Copy link
Copy Markdown
Owner Author

Once some people test it.

@jespr

jespr commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

@excid3 in your example in the PR and in active_push_native.md you have config.apple_data {} and config.google_data {} but it looks like your code expects config.apple {} and config.google {}? :)

Comment thread lib/noticed/delivery_methods/action_push_native.rb Outdated
@excid3

excid3 commented Oct 1, 2025

Copy link
Copy Markdown
Owner Author

@jespr just pushed some changes for that:

  • fixed the arguments for new
  • fixed the mismatched config names
  • renamed them to match the factory methods on APN since that's exactly what they're calling
  • updated examples

@excid3
excid3 merged commit b3f1777 into main Oct 3, 2025
51 checks passed
@excid3
excid3 deleted the action-push-native branch October 3, 2025 20:23
@arpu

arpu commented Oct 7, 2025

Copy link
Copy Markdown

to use this i have first install and migrate https://github.com/rails/action_push_native ?

@excid3

excid3 commented Oct 7, 2025

Copy link
Copy Markdown
Owner Author

Yep

required_options :devices, :format

def deliver
notification = evaluate_option(:silent) ? notification_class : notification_class.silent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

@excid3, this logic is reversed, isn't it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants