Skip to content

APNS with Certificate :missing_provider_token #228

Open

Description

@ice-cap0

Environment

Elixir 1.13.4 (compiled with Erlang/OTP 25)
macOS Monterey
{:pigeon, "~> 2.0.0-rc.0"}

Current behavior

Followed instructions here to populate files used below in config.exs:

config :myapp, MyAppWeb.APNS,
  adapter: Pigeon.APNS,
  cert: File.read!("cert.pem"),
  key: File.read!("key_unencrypted.pem"),
  mode: :dev

Push fails with :missing_provider_token

iex(2)> Pigeon.APNS.Notification.new(msg, push_token, dev_bundle_id) |> MyApp.APNS.push()
%Pigeon.APNS.Notification{
  __meta__: %Pigeon.Metadata{
    on_response: #Function<1.17011949/1 in Pigeon.push_sync/3>
  },
  collapse_id: nil,
  device_token: "c8ec24d1031bd6b6794cb443515cfc6448eccbb251b76695b74383ac920655bc",
  expiration: nil,
  id: nil,
  payload: %{"aps" => %{"alert" => "Hi"}},
  priority: nil,
  push_type: "alert",
  response: :missing_provider_token,
  topic: "com.myappco.myapp.ios.dev"
}

Expected behavior

Push goes thru

How to debug ?

Activity

  1. rajesh-blueshift commented on Aug 18, 2022

    @rajesh-blueshift

    I have been facing this with latest elixir and OTP (1.13.4/25). Downgrading to elixir 1.11.X works.
    The certificated supplied does not get recognised looks like.
    I tried using Mint HTTP2 too and same behavior. So it does not looks like related to pigeon directly. But not sure what's causing it.

  2. ice-cap0 commented on Aug 18, 2022

    @ice-cap0
    Author

    I have been facing this with latest elixir and OTP (1.13.4/25). Downgrading to elixir 1.11.X works. The certificated supplied does not get recognised looks like. I tried using Mint HTTP2 too and same behavior. So it does not looks like related to pigeon directly. But not sure what's causing it.

    I can confirm it works with 1.11.x. Could this be a plug_cowboy issue?

  3. rajesh-blueshift commented on Aug 18, 2022

    @rajesh-blueshift

    I have been facing this with latest elixir and OTP (1.13.4/25). Downgrading to elixir 1.11.X works. The certificated supplied does not get recognised looks like. I tried using Mint HTTP2 too and same behavior. So it does not looks like related to pigeon directly. But not sure what's causing it.

    I can confirm it works with 1.11.x. Could this be a plug_cowboy issue?

    I tried on pigeon 1.6. I think it is more of a lower level erlang SSL/TLS issue because I saw the same behavior with Mint too (Mint is just a wrapper over the erlang library).

  4. ice-cap0 commented on Aug 18, 2022

    @ice-cap0
    Author

    seems like it's an OTP issue, OTP 24 works while 25 fails
    following works for me

    elixir 1.13.4-otp-24
    erlang 24.3.4.3
    ...
    {:pigeon, "~> 2.0.0-rc.1"}
  5. edennis commented on Nov 15, 2022

    @edennis

    If I understand this correctly, pigeon currently does NOT work with OTP 25 as I just found out myself today. Why has this issue been closed?

  6. hpopp commented on Nov 16, 2022

    @hpopp
    Member

    This threw me for a loop. Going to reopen and take a look this week.

  7. reopened this on Nov 16, 2022
  8. dhaspden commented on Jan 19, 2023

    @dhaspden

    For the record I was able to fix this by updating to the latest version of Elixir and Erlang [25.2.1 and 1.14.3].

  9. thousandsofthem commented on Apr 18, 2023

    @thousandsofthem

    docker alpine + Elixir 1.14.0 + Erlang 25 = missing_provider_token
    docker alpine + Elixir 1.12.3 + Erlang 24 = OK
    mac + Elixir 1.14.3 + erlang 24.3.4.10 = OK

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions