Use this class to send push notifications. Internally the class uses multiple parallel tasks to transmit the notifications concurrently.

Static Methods

public static ApnsNotificationChannel OpenNotificationChannel(X509Certificate apnCertificate, bool useSandbox)

Parameter Name Parameter Type Description
apnCertificate X509Certificate The certificate used to authenticate with the Apple Push Notification Service
useSandBox bool True to use the Apple Sandbox environment, false to use the production environment

Establishes a connection to the Apple Push notification service, once a channel has been opened it must be close using a call to the Close method.

Instance Methods

public void SendNotification(ApnsNotification notification)

Parameter Name Parameter Type Description
notification ApnsNotificatio An instance of an ApnsNotification class that contains the notification to send.

Used to send a notification. The ApnsNotification class contains the payload to send and the device token that specifies the target device.

public IDictionary<ApnsNotification, IEnumerable<SendResult>> Close()

Used to close the connection, returns the results of each notification sent as a dictionary of SendResult objects. There may be multiple SendResults for a single notification is the notification failed and was retried during transmission.

public void Dispose()

Disposes the object, closing the underline connection if it has not already been closed.

Last edited Jul 13, 2011 at 3:34 PM by owenssam, version 11


No comments yet.