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

APNS with Certificate :missing_provider_token #228

Open
frozencap opened this issue Aug 18, 2022 · 8 comments
Open

APNS with Certificate :missing_provider_token #228

frozencap opened this issue Aug 18, 2022 · 8 comments

Comments

@frozencap
Copy link

frozencap commented Aug 18, 2022

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 ?

@rajesh-blueshift
Copy link

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.

@frozencap
Copy link
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?

@rajesh-blueshift
Copy link

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).

@frozencap
Copy link
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"}

@edennis
Copy link

edennis commented Nov 15, 2022

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?

@hpopp
Copy link
Member

hpopp commented Nov 16, 2022

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

@hpopp hpopp reopened this Nov 16, 2022
@dhaspden
Copy link

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].

@thousandsofthem
Copy link

thousandsofthem commented Apr 18, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants