-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PWA Push notification #4995
Comments
Why do you need ejecting? It's all about service workers and Push API/Notification API, isn't it? |
yes but I need to customize of service worker for itI find some answer here #2253 👍 |
Somewhere in your app... function requestNotificationPermission() {
// Some browsers don't support Notification yet. I'm looking at you iOS Safari
if ("Notification" in window) {
if (
Notification.permission !== "denied" &&
Notification.permission !== "granted"
) {
Notification.requestPermission();
}
}
} and somewhere else in your app... if ("Notification" in window && Notification.permission === "granted") {
new Notification("You just got poked!");
} No need to eject. For sure. If you want to integrate it into your service worker, use the |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Expected Behavior
Is anyway for implementation push notification in create-react-app without ejecting?
and is any plan to implementation natively?
The text was updated successfully, but these errors were encountered: