Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Messaging] Unable to get messaging to validate APNS payload with apns-push-type header field

Đang mở
#2,362 1 bình luận 1 reaction 1 người được giao Xem trên GitHub

@chong-shao đang làm issue này rồi.

Từ ngày 8/11/2023.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

api: messaging
[READ] Step 1: Are you in the right place?

Cloud Firestore support is provided by the @google-cloud/firestore library. Therefore the easiest and most efficient way to get Firestore issues resolved is by directly reporting them at the nodejs-firestore GitHub repo.

If you still think the problem is related to the code in this repository, then read on.

  • For issues or feature requests related to the code in this repository
    file a Github issue.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.
[REQUIRED] Step 2: Describe your environment
  • Operating System version: iOS
  • Firebase SDK version: 11.11.0
  • Firebase Product: Messaging
  • Node.js version: 16.13.1
  • NPM version: 8.10.1
[REQUIRED] Step 3: Describe the problem

I'm attempting to set more particular fields into the messaging send() function, however I continue to get failures as messaging().send() validates the JSON.

Steps to reproduce:

What happened? How can we make the problem occur?
Any time I add apns-push-type I seem to get these failures

This will print Firestore logs to the console.

>  {"severity":"ERROR","message":"Unhandled error FirebaseMessagingError: Invalid [apns-push-type] set for apns platform\n    at Function.fromServerError (/Users/evananger/Developer/blazebite-functions/functions/node_modules/firebase-admin/lib/utils/error.js:254:16)\n    at createFirebaseError (/Users/evananger/Developer/blazebite-functions/functions/node_modules/firebase-admin/lib/messaging/messaging-errors-internal.js:35:47)\n    at /Users/evananger/Developer/blazebite-functions/functions/node_modules/firebase-admin/lib/messaging/messaging-api-request-internal.js:79:75\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async /Users/evananger/Developer/blazebite-functions/functions/node_modules/firebase-functions/lib/common/providers/https.js:458:26\n    at async runFunction (/Users/evananger/.nvm/versions/node/v16.13.1/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:506:9)\n    at async runHTTPS (/Users/evananger/.nvm/versions/node/v16.13.1/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:531:5)\n    at async /Users/evananger/.nvm/versions/node/v16.13.1/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:694:21 {\n  errorInfo: {\n    code: 'messaging/invalid-argument',\n    message: 'Invalid [apns-push-type] set for apns platform'\n  },\n  codePrefix: 'messaging'\n}"}
Relevant Code:
function sendOrderReady(token) {
  const date = new Date();
  return admin.messaging().send({
    token,
    apns: {
      headers: {
        'apns-push-type': 'liveactivity',
        'apns-priority': '10'
      },
      payload: {
        aps: {
          timestamp: date.getTime(),
          event: 'update',
          'content-state': {
            orderCompleteDate: date.toISOString(),
            orderReady: true
          }

        }
      }
    }
  })
}
Ngôn ngữ chính
TypeScript
Star
1.7k
Fork
419
Merge trung bình
4 ngày 20 giờ
Pull request đã merge (30 ngày)
16

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của firebase/firebase-admin-node

Tất cả issue của firebase/firebase-admin-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.