Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Added hasPermission support for Windows platform. (#1908)
Browse files Browse the repository at this point in the history
  • Loading branch information
mac89 authored and macdonst committed Aug 17, 2017
1 parent 9b9bbca commit ddc9d2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# API

- [.init()](#pushnotificationinitoptions)
- [.hasPermission() - Android & iOS only](#pushnotificationhaspermissionsuccesshandler---android--ios-only)
- [.hasPermission()](#pushnotificationhaspermissionsuccesshandler)
- [push.on()](#pushonevent-callback)
- [push.on('registration')](#pushonregistration-callback)
- [push.on('notification')](#pushonnotification-callback)
Expand Down Expand Up @@ -114,7 +114,7 @@ var push = PushNotification.init({
});
```

## PushNotification.hasPermission(successHandler) - Android & iOS only
## PushNotification.hasPermission(successHandler)

Checks whether the push notification permission has been granted.

Expand Down
5 changes: 5 additions & 0 deletions src/windows/PushPluginProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ module.exports = {
onFail(ex);
}
},
hasPermission: function (onSuccess) {
var notifier = Windows.UI.Notifications.ToastNotificationManager.createToastNotifier();

onSuccess({ isEnabled: !notifier.setting });
},
subscribe: function() {
console.log("Subscribe is unsupported");
},
Expand Down

0 comments on commit ddc9d2d

Please sign in to comment.