Skip to content

Commit 77eb971

Browse files
committed
Update README to refer to async methods
1 parent 88d4fb1 commit 77eb971

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ var vapidDetails = new VapidDetails(subject, publicKey, privateKey);
5252
var webPushClient = new WebPushClient();
5353
try
5454
{
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);
5757
}
5858
catch (WebPushException exception)
5959
{
@@ -63,7 +63,7 @@ catch (WebPushException exception)
6363

6464
# API Reference
6565

66-
## SendNotification(pushSubscription, payload, vapidDetails|gcmAPIKey|options)
66+
## SendNotificationAsync(pushSubscription, payload, vapidDetails|gcmAPIKey|options, cancellationToken)
6767

6868
```csharp
6969
var subscription = new PushSubscription(pushEndpoint, p256dh, auth);
@@ -75,15 +75,15 @@ options["vapidDetails"] = new VapidDetails(subject, publicKey, privateKey);
7575
var webPushClient = new WebPushClient();
7676
try
7777
{
78-
webPushClient.SendNotification(subscription, "payload", options);
78+
webPushClient.SendNotificationAsync(subscription, "payload", options);
7979
}
8080
catch (WebPushException exception)
8181
{
8282
Console.WriteLine("Http STATUS code" + exception.StatusCode);
8383
}
8484
```
8585

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
8787
method will work without a GCM API Key and / or VAPID keys if the push service
8888
supports it.
8989

0 commit comments

Comments
 (0)