firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.84k stars 889 forks source link

Safari dont ask permission #8596

Open bangln opened 2 hours ago

bangln commented 2 hours ago

Operating System

IOS 16.4

Environment (if applicable)

React js

Firebase SDK Version

10.14.0

Firebase SDK Product(s)

Messaging

Project Tooling

React

Detailed Problem Description

I need to get message token in safari but it dont ask permission

Steps and code to reproduce issue

here is my code, it works on chrome but in safari it dont ask permission const getToken = async () => { if (Notification) { const permission = await Notification.requestPermission(); if (permission === "granted") { try { const token = await getMessagingToken(); if (token !== firebaseToken) { setFirebaseToken(token); await pushToken({ variables: { token } }); } } catch (e) { console.log(e); } } } };

google-oss-bot commented 2 hours ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.