quickstart-js icon indicating copy to clipboard operation
quickstart-js copied to clipboard

Is this supposed to work cross-browser?

Open miloskroulik opened this issue 5 years ago • 6 comments

I tried to follow instructions at https://github.com/firebase/quickstart-js/tree/master/messaging as closely as possible, but I still find the behavior of the messaging quickstart inconsistent -while it works in Chrome as well as FF, the subscription button doesn't show up in either browser. This is not a big issue, because the browser displays a popup asking user to subscribe. This popup needs to be manually selected in Firefox. I wasn't able to debug the inline script in index.html - it looks like it's not executed. Am I doing anything wrong?

miloskroulik avatar Jan 06 '21 19:01 miloskroulik

@miloskroulik yeah I just took a look at the messaging sample and it seems to be broken in a few ways:

  1. The magic __init.js file from the local hosting server doesn't include the appId so initialization doesn't work (https://github.com/firebase/firebase-tools/issues/2798)
  2. I get some MIME type errors in the console (see below)
  3. The UI does not load, as you said
Screen Shot 2021-01-07 at 4 33 53 PM

@kroikie or @jhuleatt can you take a look?

samtstern avatar Jan 07 '21 16:01 samtstern

Thanks for your observations and help. In addition, I wasn't able to make the messaging quickstart work on several Android browsers, where "ordinary" push notifications worked fine (such as example at https://serviceworke.rs/push-payload_demo.html). I'm not sure if this is in scope of this issue - please let me know if I should provide more details here or in a separate issue.

miloskroulik avatar Jan 07 '21 16:01 miloskroulik

@miloskroulik that's a separate issue I think. What are "ordinary" push notifications?

samtstern avatar Jan 07 '21 16:01 samtstern

@samtstern Alright, I will do it. I also added link to the working example.

miloskroulik avatar Jan 07 '21 16:01 miloskroulik

@jamesdaniels is going to take a look at this sample

samtstern avatar Jan 13 '21 11:01 samtstern

I suspect most of this has to do with the quickstart using the depreciated FCM API. There are some sharp corners there in terms of race conditions when adding the VAPID key, asking for permission, and registering the service-worker; the new API seems to work a lot better in my experience with AngularFire. I'll get this up to date and do some x-browser testing.

See also #525. Def looks like we have a couple issues.

jamesdaniels avatar Jan 13 '21 15:01 jamesdaniels