mikecann / mikecann.blog

Mike Cann's Blog
https://mikecann.blog
4 stars 1 forks source link

Firebase Cloud Messaging and Chrome Extension Manifest V3 #144

Open mikecann opened 1 year ago

mikecann commented 1 year ago

Firebase Cloud Messaging and Chrome Extension Manifest V3

http://localhost:3000/posts/firebase-cloud-messaging-and-chrome-extension-manifest-v3

mikecann commented 1 year ago

imported Disqus comment by 'mikeysee' @2022-06-18 09:14:51_

Just as a quick note: Simeon has opened a chrome feature request to remove the notification requirement of Web Push for extensions: https://twitter.com/dotprot...

mikecann commented 1 year ago

imported Disqus comment by 'Artem' @2022-07-12 05:05:21_

Hi
do you have a repository with this example?

mikecann commented 1 year ago

imported Disqus comment by 'mikeysee' @2022-07-13 09:15:35_

unfortunately not, tho you should be able to take any off the shelf basic example and dump my example from the post in it and it should work.

mikecann commented 1 year ago

imported Disqus comment by 'Feroz' @2023-02-03 04:15:47_

TS2339: Property 'registration' does not exist on type 'Window & typeof globalThis'.

I am getting this error

mikecann commented 1 year ago

imported Disqus comment by 'mikeysee' @2023-02-03 08:36:05_

Ah the types may have changed. Just type it as any for now.

mikecann commented 1 year ago

imported Disqus comment by 'Feroz Siddiqui' @2023-02-03 02:01:21_

Npm build fails when I run it

mikecann commented 1 year ago

imported Disqus comment by 'Feroz Siddiqui' @2023-02-03 02:15:29_

its been removed i guess , any is also not working getting same error

mikecann commented 1 year ago

imported Disqus comment by 'Feroz' @2023-02-03 03:20:26_

Uncaught (in promise) FirebaseError: Messaging: The input to useServiceWorker() must be a ServiceWorkerRegistration. (messaging/invalid-sw-registration). getting this error

mikecann commented 1 year ago

imported Disqus comment by 'Eduardo Filacchione' @2023-04-10 11:37:04_

adding that code in background.js thwos this error:

Uncaught SyntaxError: Cannot use import statement outside a module

shivaniw2 commented 1 month ago

"background": { "service_worker": "background.js", "type": "module" },

Using type module against background.js in manifest file can help with Uncaught SyntaxError: Cannot use import statement outside a module error in manifest file.

mikecann commented 1 month ago

"background": { "service_worker": "background.js", "type": "module" },

Using type module against background.js in manifest file can help with Uncaught SyntaxError: Cannot use import statement outside a module error in manifest file.

Good to know, thanks!

shivaniw2 commented 1 month ago

Hi can you share the code base for this or step by step tutorial for FCM in chrome extension v3. I have been trying for some while to make it work but someway or the other it fails. Would be very helpful, thanks in advance.

mikecann commented 1 month ago

Hi can you share the code base for this or step by step tutorial for FCM in chrome extension v3. I have been trying for some while to make it work but someway or the other it fails. Would be very helpful, thanks in advance.

I have replied to your email to me ;)