this is my first question on Stack Overflow!
I am trying to deploy my firebase application on the firebase server using the ' firebase deploy' mand. While running the "messaging" example [provided by Firebase] on my local machine, I have no issues generating an instance ID. However, when I deploy the application on the Firebase server and run the app in the browser, the application is not able to retrieve the Instance ID from the FCM server. This is a snippet of the response that I am getting from the Chrome console:
No Instance ID token available. Request permission to generate one.
(index):226 Requesting permission...
(index):239 Unable to get permission to notify. V
(index):226 Requesting permission...
(index):239 Unable to get permission to notify. V {code:
"messaging/permission-blocked",
message: "Messaging: The required permissions were not grant… blocked instead. (messaging/permission-blocked)."}
code: "messaging/permission-blocked"message: "Messaging: The required permissions were not granted and blocked instead. (messaging/permission-blocked)."stack: (...) ....
this is my first question on Stack Overflow!
I am trying to deploy my firebase application on the firebase server using the ' firebase deploy' mand. While running the "messaging" example [provided by Firebase] on my local machine, I have no issues generating an instance ID. However, when I deploy the application on the Firebase server and run the app in the browser, the application is not able to retrieve the Instance ID from the FCM server. This is a snippet of the response that I am getting from the Chrome console:
No Instance ID token available. Request permission to generate one.
(index):226 Requesting permission...
(index):239 Unable to get permission to notify. V
(index):226 Requesting permission...
(index):239 Unable to get permission to notify. V {code:
"messaging/permission-blocked",
message: "Messaging: The required permissions were not grant… blocked instead. (messaging/permission-blocked)."}
code: "messaging/permission-blocked"message: "Messaging: The required permissions were not granted and blocked instead. (messaging/permission-blocked)."stack: (...) ....
Share
Improve this question
edited Oct 28, 2016 at 14:08
Frank van Puffelen
600k85 gold badges889 silver badges859 bronze badges
asked Oct 28, 2016 at 6:00
Aman ZeeAman Zee
331 gold badge2 silver badges7 bronze badges
1 Answer
Reset to default 5It looks like you haven't request permission to receive notifications:
The method
messaging.requestPermission()
displays a consent dialog to let users grant your app permission to receive notifications in the browser. If permission is denied, FCM registration token requests result in an error.messaging.requestPermission() .then(function() { console.log('Notification permission granted.'); // TODO(developer): Retrieve a Instance ID token for use with FCM. // ... }) .catch(function(err) { console.log('Unable to get permission to notify. ', err); });
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742331382a4423789.html
评论列表(0条)