最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - Does apple wallet supports notification for generic passes on Update? - Stack Overflow

programmeradmin3浏览0评论

I am creating generic passes in Nodejs, where update is working fine. Whenever i am updating amount it is updating it on real-time.

But i am not getting notifications for it.

const apn = require("apn");

const apnOptions = {
    token: {
        key: "./path/to/file.p8", 
        keyId: "KEYID",  
        teamId: "TEAMID",  
    },
    production: true, // Set to `true` for production
};
const apnProvider = new apn.Provider(apnOptions);

 sendPassUpdateNotification: async (data) => {
       
        const pushToken = 'device-token'

        if (!pushToken) {
            console.log("❌ No push token found for device:", deviceLibraryIdentifier);
            return;
        }


        const notification = new apn.Notification({
            alert: "Your pass has been updated.",
            topic: "pass.test",
            sound: "ping.aiff",
            badge: 1,
            contentAvailable: true, 
        });
        try {
            let response = await apnProvider.send(notification, pushToken);
            console.log("
发布评论

评论列表(0)

  1. 暂无评论