{{SeeCompatTable}}{{ApiRef("Push API")}}
The PushManager.hasPermission()
method of the {{domxref("PushManager")}} interface returns a {{jsxref("Promise")}} that resolves to the PushPermissionStatus
of the requesting webapp, which will be one of granted
, denied
, or default
.
Syntax
PushManager.hasPermission().then(function(pushPermissionStatus) { ... } );
Example
// TBD
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('Push API', '#pushmanager-interface', 'PushManager')}} | {{Spec2('Push API')}} | Initial definition. |
Browser Compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(42.0)}} (behind a flag) | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatChrome(42.0)}} (behind a flag) |