Partager via


PKPassLibrary.Notifications.ObserveRemotePaymentPassesDidChange Méthode

Définition

Surcharges

ObserveRemotePaymentPassesDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la RemotePaymentPassesDidChangeNotification constante.

ObserveRemotePaymentPassesDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la RemotePaymentPassesDidChangeNotification constante.

ObserveRemotePaymentPassesDidChange(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la RemotePaymentPassesDidChangeNotification constante.

public static Foundation.NSObject ObserveRemotePaymentPassesDidChange (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveRemotePaymentPassesDidChange : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour RemotePaymentPassesDidChangeNotification s’abonner aux notifications.

// Listen to all notifications posted for any object
var token = PKPassLibrary.Notifications.ObserveRemotePaymentPassesDidChange ((notification) => {
	Console.WriteLine ("Observed RemotePaymentPassesDidChangeNotification!");
};

// Listen to all notifications posted for a single object
var token = PKPassLibrary.Notifications.ObserveRemotePaymentPassesDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed RemotePaymentPassesDidChangeNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

S’applique à

ObserveRemotePaymentPassesDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la RemotePaymentPassesDidChangeNotification constante.

public static Foundation.NSObject ObserveRemotePaymentPassesDidChange (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveRemotePaymentPassesDidChange : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour RemotePaymentPassesDidChangeNotification s’abonner aux notifications.

// Listen to all notifications posted for any object
var token = PKPassLibrary.Notifications.ObserveRemotePaymentPassesDidChange ((notification) => {
	Console.WriteLine ("Observed RemotePaymentPassesDidChangeNotification!");
};

// Listen to all notifications posted for a single object
var token = PKPassLibrary.Notifications.ObserveRemotePaymentPassesDidChange (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed RemotePaymentPassesDidChangeNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

S’applique à