Skip to content

Commit c891053

Browse files
ntamasmacdonst
authored andcommittedMar 6, 2018
✨ PushNotification.hasPermission() is now supported in the browser (phonegap#2236)
1 parent b046cc9 commit c891053

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎www/browser/push.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ module.exports = {
367367
},
368368

369369
hasPermission: function(successCallback, errorCallback) {
370-
successCallback(true);
370+
const granted = Notification && Notification.permission === 'granted';
371+
successCallback({
372+
isEnabled: granted
373+
});
371374
},
372375

373376
unregister: function(successCallback, errorCallback, options) {

0 commit comments

Comments
 (0)
Please sign in to comment.