Open NolanOfficial opened 1 month ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Thanks for reporting this. Are you able to reproduce this issue on your local development environment or does this only happen on Cloud Functions?
So I'm using Node.js and tried to replicate the function on a custom node from scratch (making a request to Apple's APN server). Using http2 gave me the same error warning. Perhaps it's JavaScript's http2 library that's causing the issue but I'm not a JS expert so maybe there was something I missed.
The code sample you provided shows that you are using the send()
API. Are you sending a single message? If so, any reason you would prefer to use http/2 for that?
I'm sending a single notification, yes. And the reason for http2 is the apple requirement for sending and receiving APNs (as they will only accept requests that way). I noticed Firebase Messaging Nodejs uses http/2 by default and has an option for enabling legacy requests. I tried both, but both failed.
[READ] Step 1: Are you in the right place?
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
When trying to send an iOS push notification (APN) through firebase cloud functions using firebase messaging, it fails with an error message (summarized from cloud functions log):
Sending an APN request via cURL through the terminal, using http/2 gives a valid response and the notification shows. It also works via Firebase Messaging dashboard when testing a push notification.
All APN certificates (the method I'm using) have been added to Firebase in project settings, and they have all been verified.
Steps to reproduce:
Relevant Code:
Index.ts file
APN notification file.ts