safwanrahman / django-webpush

Web Push Notification Package for Django
GNU General Public License v3.0
362 stars 103 forks source link

When I integrate nuxt and django-webpush, it only doesn't work with msedge. #136

Closed quroom closed 5 months ago

quroom commented 5 months ago

I don understand why it happens. But I check it is ok with only tested in django-webpush with template index page. However, when I integrate nuxt and django, like subscribe in frontend and send subscription info to backend. And then backend will use it later. I guess it should be working but somehow it doesn't work only in ms edge. It works in chrome, sidekick,

I already left the question in pywebpush, But this repo is more active so I write question here too.

quroom commented 5 months ago

I am not sure what the problem was exactly. But now it works. I only changed urlBase64ToUint8Array function const base64 = (base64String + padding).replace(/-/g, "+").replace(/_/g, "/"); to

const base64 = (base64String + padding)
    // eslint-disable-next-line no-useless-escape
    .replace(/\-/g, "+")
    .replace(/_/g, "/");

I don't think it is related. As long as I figure out it, I will leave some comment.

quroom commented 5 months ago

It's not bug but I am ussing send_to_subscription function. It doesn't work well.. when I use send_user_notification it works propertly.

quroom commented 5 months ago

It's because of ttl I didn't write.