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);
}
}
}
};
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); } } } };