Notification for user adding Apple Pay card

I would like to update the Apple Pay button in our app when a user adds a card, but we are unable to figure how to use the proper PassKit/Apple Pay API.


When a user doesn't have an Apple Pay card setup, the Apple Pay button is labeled "Setup Apple Pay", which, when tapped, opens the Wallet app to setup Apple Pay. However, after the user returns to our app, the Apple Pay button doesn't change to "Pay with Apple Pay". This is because we need some asynchronous notification to tell our app that a card has been successfully added, but we cannot figure out how to implement one.


There is a notification called "PKPassLibraryDidChange" documented at the link below, but I couldn't figure how to add an observer for it.


https://developer.apple.com/documentation/passkit/pkpasslibrarynotificationname/1617102-pkpasslibrarydidchange


I tried different variations of the code below, but none of them worked.


    let passKitDidChange = NSNotification.Name(rawValue: PKPassLibraryNotificationName.PKPassLibraryDidChange.rawValue)

    NotificationCenter.default.addObserver(
        self,
        selector: #selector(updateApplePayButton),
        name: passKitDidChange,
        object: nil
    )


I'm not sure if the approach above is the correct one, but does anybody know how to monitor for changes in PassKit (for when a user adds a card)?