Comments (4)
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.
I just tried using this library and had the same issue.
from web-push-csharp.
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.
thanks for the help that was the issue !
from web-push-csharp.
Related Issues (20)
- Not working on Edge and Safari HOT 1
- Upgrade to .NET 8 HOT 1
- Does this library support Decryption of payload message at endpoint?
- Upgrade to .NET 6
- Support STJ HOT 1
- Unfriendly exceptions are thrown when a malformed p256dh key is provided HOT 1
- WebPushClient: Implement an interface for mocking in UnitTests HOT 1
- SendNotificationAsync not working on Server HOT 1
- Why does NuGet package not updating HOT 1
- Remove Newtonsoft.Json dependency HOT 4
- The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
- .Net - NOT CORE! - Exception thrown: 'System.ArgumentException' in WebPush.dll HOT 1
- .NETStandard 2.0 not supported HOT 1
- Push notification Click Event not firing HOT 1
- Upgrade Portable.BouncyCastle C# .NET 1.8.8 or later. HOT 1
- Error 406 was encountered in sending push request, and the reason could not be found
- Subscription no longer valid. Details: push subscription has unsubscribed or expired.
- Apple web push causing errors HOT 8
- Customize link and icon in notification message HOT 1
- Upgrade to .NET 7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-push-csharp.