feat: add ios specific push notification instructions

Closes #2992
This commit is contained in:
Gabe Kangas
2023-05-21 14:12:14 -07:00
parent 9d5482adf6
commit 447ab10738
4 changed files with 88 additions and 9 deletions

View File

@@ -1,3 +1,15 @@
export default function isPushNotificationSupported() {
return 'serviceWorker' in navigator && 'PushManager' in window;
import { isMobileSafariIos } from './helpers';
export function arePushNotificationSupported() {
return 'Notification' in window && 'serviceWorker' in navigator && 'PushManager' in window;
}
export function canPushNotificationsBeSupported() {
// Mobile safari will return false for supporting push notifications, but
// it does support them. So we need to check for mobile safari and return
// true if it is.
if (isMobileSafariIos()) {
return true;
}
return 'Notification' in window && 'serviceWorker' in navigator && 'PushManager' in window;
}