如果您在上传APNS证书时遇到问题,请遵循以下步骤解决:
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert YourAppCert.pem -key YourAppKey.pem
// Create a credential with a cert and key const admin = require('firebase-admin'); const serviceAccount = require('path/to/serviceAccountKey.json'); const fs = require('fs');
const cert = fs.readFileSync('path/to/cert.pem').toString(); const key = fs.readFileSync('path/to/key.pem').toString();
const credential = admin.credential.cert({
projectId: serviceAccount.project_id,
clientEmail: serviceAccount.client_email,
certificate: cert,
privateKey: key,
databaseURL: "https://
// Initialize the app with the credential admin.initializeApp({ credential: credential });