Skip to content

Commit 562ef2c

Browse files
fix/android-has-permission
1 parent d335b5c commit 562ef2c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/local-notifications.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements
7979
return new Promise((resolve, reject) => {
8080
try {
8181
// nothing to do on this platform
82-
resolve(true);
82+
var context = utils.ad.getApplicationContext();
83+
const hasPermission=NotificationManagerCompatPackageName.NotificationManagerCompat.from(context).areNotificationsEnabled();
84+
resolve(hasPermission);
8385
} catch (ex) {
8486
console.log("Error in LocalNotifications.hasPermission: " + ex);
8587
reject(ex);

0 commit comments

Comments
 (0)