EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

Android is always returning true #173

Closed ezlo-ionutrusu closed 4 years ago

ezlo-ionutrusu commented 5 years ago

If u disable the notifications in settings it will not work anymore. Propose modifying the local-notifications.android.js to

LocalNotificationsImpl.prototype.hasPermission = function () { return new Promise(function (resolve, reject) { try { var context = utils.ad.getApplicationContext(); const hasPermission=NotificationManagerCompatPackageName.NotificationManagerCompat.from(context).areNotificationsEnabled(); console.log(hasPermission:${hasPermission}); resolve(hasPermission); } catch (ex) { console.log("Error in LocalNotifications.hasPermission: " + ex); reject(ex); } }); };

EddyVerbruggen commented 4 years ago

Fixed by #175