@@ -52,8 +52,8 @@ var vapidDetails = new VapidDetails(subject, publicKey, privateKey);
52
52
var webPushClient = new WebPushClient ();
53
53
try
54
54
{
55
- webPushClient .SendNotification (subscription , " payload" , vapidDetails );
56
- // webPushClient.SendNotification (subscription, "payload", gcmAPIKey);
55
+ await webPushClient .SendNotificationAsync (subscription , " payload" , vapidDetails );
56
+ // await webPushClient.SendNotificationAsync (subscription, "payload", gcmAPIKey);
57
57
}
58
58
catch (WebPushException exception )
59
59
{
@@ -63,7 +63,7 @@ catch (WebPushException exception)
63
63
64
64
# API Reference
65
65
66
- ## SendNotification (pushSubscription, payload, vapidDetails|gcmAPIKey|options)
66
+ ## SendNotificationAsync (pushSubscription, payload, vapidDetails|gcmAPIKey|options, cancellationToken )
67
67
68
68
``` csharp
69
69
var subscription = new PushSubscription (pushEndpoint , p256dh , auth );
@@ -75,15 +75,15 @@ options["vapidDetails"] = new VapidDetails(subject, publicKey, privateKey);
75
75
var webPushClient = new WebPushClient ();
76
76
try
77
77
{
78
- webPushClient .SendNotification (subscription , " payload" , options );
78
+ webPushClient .SendNotificationAsync (subscription , " payload" , options );
79
79
}
80
80
catch (WebPushException exception )
81
81
{
82
82
Console .WriteLine (" Http STATUS code" + exception .StatusCode );
83
83
}
84
84
```
85
85
86
- > ** Note:** ` SendNotification ()` you don't need to define a payload, and this
86
+ > ** Note:** ` SendNotificationAsync ()` you don't need to define a payload, and this
87
87
method will work without a GCM API Key and / or VAPID keys if the push service
88
88
supports it.
89
89
0 commit comments