@@ -32,7 +32,7 @@ protected HttpClient httpClient
3232
3333 return _httpClient ;
3434 }
35- }
35+ }
3636
3737 /// <summary>
3838 /// When sending messages to a GCM endpoint you need to set the GCM API key
@@ -231,52 +231,52 @@ public HttpRequestMessage GenerateRequestDetails(PushSubscription subscription,
231231 return request ;
232232 }
233233
234- /// <summary>
235- /// To send a push notification call this method with a subscription, optional payload and any options
236- /// Will exception is unsuccessful
237- /// </summary>
238- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
239- /// <param name="payload">The payload you wish to send to the user</param>
240- /// <param name="options">Options for the GCM API key and vapid keys can be passed in if they are unique for each notification.</param>
241- public void SendNotification ( PushSubscription subscription , string payload = null , Dictionary < string , object > options = null )
242- {
243- SendNotificationAsync ( subscription , payload , options ) . Wait ( ) ;
244- }
245-
246- /// <summary>
247- /// To send a push notification call this method with a subscription, optional payload and any options
248- /// Will exception is unsuccessful
249- /// </summary>
250- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
251- /// <param name="payload">The payload you wish to send to the user</param>
252- /// <param name="vapidDetails">The vapid details for the notification.</param>
253- public void SendNotification ( PushSubscription subscription , string payload , VapidDetails vapidDetails )
254- {
255- SendNotificationAsync ( subscription , payload , vapidDetails ) . Wait ( ) ;
256- }
257-
258- /// <summary>
259- /// To send a push notification call this method with a subscription, optional payload and any options
260- /// Will exception is unsuccessful
261- /// </summary>
262- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
263- /// <param name="payload">The payload you wish to send to the user</param>
264- /// <param name="gcmAPIKey">The GCM API key</param>
265- public void SendNotification ( PushSubscription subscription , string payload , string gcmAPIKey )
266- {
267- SendNotificationAsync ( subscription , payload , gcmAPIKey ) . Wait ( ) ;
268- }
269-
270- /// <summary>
271- /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
272- /// Will exception is unsuccessful
273- /// </summary>
274- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
275- /// <param name="payload">The payload you wish to send to the user</param>
276- /// <param name="options">Options for the GCM API key and vapid keys can be passed in if they are unique for each notification.</param>
277- public async Task SendNotificationAsync ( PushSubscription subscription , string payload = null , Dictionary < string , object > options = null )
234+ /// <summary>
235+ /// To send a push notification call this method with a subscription, optional payload and any options
236+ /// Will exception is unsuccessful
237+ /// </summary>
238+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
239+ /// <param name="payload">The payload you wish to send to the user</param>
240+ /// <param name="options">Options for the GCM API key and vapid keys can be passed in if they are unique for each notification.</param>
241+ public void SendNotification ( PushSubscription subscription , string payload = null , Dictionary < string , object > options = null )
242+ {
243+ SendNotificationAsync ( subscription , payload , options ) . Wait ( ) ;
244+ }
245+
246+ /// <summary>
247+ /// To send a push notification call this method with a subscription, optional payload and any options
248+ /// Will exception is unsuccessful
249+ /// </summary>
250+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
251+ /// <param name="payload">The payload you wish to send to the user</param>
252+ /// <param name="vapidDetails">The vapid details for the notification.</param>
253+ public void SendNotification ( PushSubscription subscription , string payload , VapidDetails vapidDetails )
254+ {
255+ SendNotificationAsync ( subscription , payload , vapidDetails ) . Wait ( ) ;
256+ }
257+
258+ /// <summary>
259+ /// To send a push notification call this method with a subscription, optional payload and any options
260+ /// Will exception is unsuccessful
261+ /// </summary>
262+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
263+ /// <param name="payload">The payload you wish to send to the user</param>
264+ /// <param name="gcmAPIKey">The GCM API key</param>
265+ public void SendNotification ( PushSubscription subscription , string payload , string gcmAPIKey )
266+ {
267+ SendNotificationAsync ( subscription , payload , gcmAPIKey ) . Wait ( ) ;
268+ }
269+
270+ /// <summary>
271+ /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
272+ /// Will exception is unsuccessful
273+ /// </summary>
274+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
275+ /// <param name="payload">The payload you wish to send to the user</param>
276+ /// <param name="options">Options for the GCM API key and vapid keys can be passed in if they are unique for each notification.</param>
277+ public async Task SendNotificationAsync ( PushSubscription subscription , string payload = null , Dictionary < string , object > options = null )
278278 {
279-
279+
280280 HttpRequestMessage request = GenerateRequestDetails ( subscription , payload , options ) ;
281281
282282 HttpResponseMessage response = await httpClient . SendAsync ( request ) ;
@@ -285,31 +285,31 @@ public async Task SendNotificationAsync(PushSubscription subscription, string pa
285285 {
286286 throw new WebPushException ( @"Received unexpected response code" , response . StatusCode , response . Headers , subscription ) ;
287287 }
288-
288+
289289 }
290290
291- /// <summary>
292- /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
293- /// Will exception is unsuccessful
294- /// </summary>
295- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
296- /// <param name="payload">The payload you wish to send to the user</param>
297- /// <param name="vapidDetails">The vapid details for the notification.</param>
298- public async Task SendNotificationAsync ( PushSubscription subscription , string payload , VapidDetails vapidDetails )
291+ /// <summary>
292+ /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
293+ /// Will exception is unsuccessful
294+ /// </summary>
295+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
296+ /// <param name="payload">The payload you wish to send to the user</param>
297+ /// <param name="vapidDetails">The vapid details for the notification.</param>
298+ public async Task SendNotificationAsync ( PushSubscription subscription , string payload , VapidDetails vapidDetails )
299299 {
300300 Dictionary < string , object > options = new Dictionary < string , object > ( ) ;
301301 options [ "vapidDetails" ] = vapidDetails ;
302302 await SendNotificationAsync ( subscription , payload , options ) ;
303303 }
304304
305- /// <summary>
306- /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
307- /// Will exception is unsuccessful
308- /// </summary>
309- /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
310- /// <param name="payload">The payload you wish to send to the user</param>
311- /// <param name="gcmAPIKey">The GCM API key</param>
312- public async Task SendNotificationAsync ( PushSubscription subscription , string payload , string gcmAPIKey )
305+ /// <summary>
306+ /// To send a push notification asyncronously call this method with a subscription, optional payload and any options
307+ /// Will exception is unsuccessful
308+ /// </summary>
309+ /// <param name="subscription">The PushSubscription you wish to send the notification to.</param>
310+ /// <param name="payload">The payload you wish to send to the user</param>
311+ /// <param name="gcmAPIKey">The GCM API key</param>
312+ public async Task SendNotificationAsync ( PushSubscription subscription , string payload , string gcmAPIKey )
313313 {
314314 Dictionary < string , object > options = new Dictionary < string , object > ( ) ;
315315 options [ "gcmAPIKey" ] = gcmAPIKey ;
0 commit comments