Giter VIP home page Giter VIP logo

Comments (4)

adrienboutreauu avatar adrienboutreauu commented on June 12, 2024

Ok after checks response of await httpClient.SendAsync(request) is :

response = {StatusCode: 400, ReasonPhrase: 'InvalidParameters', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:

And this is the request :

System.Net.Http.ByteArrayContent, Headers:
{
TTL: 2419200
Encryption: salt=1jlqUA2jpFo7KQ_dMxeAIw
Authorization: WebPush eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJhdWQiOiJodHRwczovL2ZjbS5nb29nbGVhcGlzLmNvbSIsImV4cCI6MTUwMzEwMzAxMiwic3ViIjoibWFpbHRvOmV4YW1wbGVAZXhhbXBsZS5jb20ifQ.JlZRlYE5eqAJ2roRz4-UccbnFXO70wstI-7ymbgxvYx-6B34cvnXtqOvAv1p9HiawGrG4ZySXdT3hSFqUFojHw
Crypto-Key: dh=BJU-Ox7bemC9Y1YInwSJc8WwujnrD67hIp0zwWHGNZy0DliLcHDO-8SYspGSV8LcOxW1tRFMwJUgxi2V-VF6fFs;p256ecdsa=BJGjyWr8QKSz3UeGczPbQaC8qrfizZ+ghxyOJogizfG6Z5simwivn7pJDxa+WnuqCa/ofwy1Wx5eIHVsSUvxXVE
Content-Type: application/octet-stream
Content-Length: 25
Content-Encoding: aesgcm
}

from web-push-csharp.

Vannevelj avatar Vannevelj commented on June 12, 2024

I just tried using this library and had the same issue.

from web-push-csharp.

Vannevelj avatar Vannevelj commented on June 12, 2024

I'm not sure what the issue was but I tried it with VAPID keys and it worked (VapidHelper.GenerateVapidKeys();) and passed in the public key to

registration.pushManager
   .subscribe({
       userVisibleOnly: true,
       applicationServerKey: urlBase64ToUint8Array("Public_Key")
   })

The base64 conversion function I found here: https://gist.github.com/malko/ff77f0af005f684c44639e4061fa8019

from web-push-csharp.

adrienboutreauu avatar adrienboutreauu commented on June 12, 2024

thanks for the help that was the issue !

from web-push-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.