[DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The problem is developer have to add a callback and catch the error.
// send this notification to All Users except Inactive ones
myClient.sendNotification(firstNotification, function (err, httpResponse,data) {
if (err) {
console.log('Something went wrong…');
} else {
console.log(data, httpResponse.statusCode);
}
}).catch(() => {
console.log('Something went wrong…');
});
Promise are rejected even if callback are pass to onesignal notification. It result to reject a promise which is not handle.
https://github.com/zeyneloz/onesignal-node/blob/32d35f8dae14d052e47b66e766e2b91df1ac06e6/lib/client.js#L37-L40
[DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The problem is developer have to add a callback and catch the error.