我的工作Tizen耐磨獨立 Web應用程序,並希望整合火力地堡納入通知功能。我遵循使用JavaScript的firebase提供的所有步驟。但我無法獲得令牌,並結束了與下面的錯誤:FCM爲Tizen Werable Web應用程序
Failed to register a ServiceWorker: The URL protocol of the current origin
('file://') is not supported."
code: "messaging/failed-serviceworker-registration"
message: "Messaging: We are unable to register the default service worker.
Failed to register a ServiceWorker: The URL protocol of the current origin
('file://') is not supported. (messaging/failed-serviceworker-
registration)."
stack: (...)
我試圖
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log("success")
firebase.messaging().useServiceWorker(registration)
// Registration was successful
console.log('ServiceWorker registration successful with scope: ',registration.scope);
// registration.pushManager.subscribe({
console.log('Registration was successful1');
// userVisibleOnly: true
}).then(function(sub) {
console.log('endpoint:', sub.endpoint);
}).catch(function(e) {
console.log('Registration Failed',e);
});
但無法得到它的工作。請讓我知道FCM是否提供了對Tizen Web應用程序的支持,因爲我已經看到FCM提供者爲Android,iOS和Javascript提供了訪問權限。但是我沒有看到對Tizen Web應用程序(可穿戴混合應用程序)的支持。