Saturday, February 4, 2023
HomeiOS Developmentnode.js - iOS Push Notification Error: {cause: 'TopicDisallowed'}

node.js – iOS Push Notification Error: {cause: ‘TopicDisallowed’}

[Please read carefully before answering.]

I am struggling to resolve notifications for greater than per week and nonetheless, it is midway resolved.

  • I am utilizing the manufacturing certificates.
  • It is working effective typically and all of the sudden begins throwing: { cause: ‘TopicDisallowed’ }
  • It is working completely effective on localhost.
  • It really works effective typically on the server too (the difficulty is unstable). It routinely begins working and stops.

Right here is the supplier config:

const apn = require('apn'); // model: "apn": "^2.2.0"
const iosOptions = {
  token: {
    key: path.resolve('./lib/AuthK*********.p8'),
    keyId: '*********',
    teamId: '*******'
  manufacturing: true

const apnProvider = new apn.Supplier(iosOptions);
const apnNotification = new apn.Notification();
apnNotification.sound = 'default';
apnNotification.title="Good day";
apnNotification.physique = 'Good day message';
apnNotification.aps.threadId = 'thread_id';
apnNotification.matter = matter;
apnNotification.payload = payload;

return apnProvider.ship(apnNotification, token)

Is there something incorrect with the config?

Error message: cause: 'TopicDisallowed'

Please assist if somebody is aware of the answer.



Please enter your comment!
Please enter your name here

two × three =

Most Popular

Recent Comments