admin管理员组文章数量:1333385
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); });
本文标签: javascriptFirebase Cloud Messaging Failing to Retrieve Instance IDStack Overflow
版权声明:本文标题:javascript - Firebase Cloud Messaging Failing to Retrieve Instance ID - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742331381a2454764.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论