Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set apns headers in FCM.Notification.payload #222

Open
rlopzc opened this issue Jun 6, 2022 · 0 comments
Open

Set apns headers in FCM.Notification.payload #222

rlopzc opened this issue Jun 6, 2022 · 0 comments

Comments

@rlopzc
Copy link

rlopzc commented Jun 6, 2022

Environment

  • Elixir & Erlang/OTP versions (elixir --version): 1.12.2
  • Operating system: Linux

Current behavior

Manually setting APNS apns-collapse-id header does not work.

alias Pigeon.FCM

notification = 
  FCM.Notification.new("token", %{title: "Test"})
  |> Map.update(:payload, %{}, &(Map.put(&1, :apns, %{headers: %{"apns-collapse-id" => "1"}})))

# First notification
FCM.push(notification)

# Second notification
FCM.push(notification)

When testing it with my phone, the same notification arrives twice.

How do I set the apns collapse id to sent through FCM?
I'm not sure if that's the way to set the apns headers field in an FCM.Notification struct.

Documentation:

Expected behavior

Setting APNS collapse-id header replaces previous notification with the same apns-collapse-id

@rlopzc rlopzc changed the title Set apns headers in payload Set apns headers in FCM.Notification.payload Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant