How to open 'Add Payment Method' device settings from within a native iOS app?

Viewed 120

I would like to provide users of my iOS app convenient access to changing their Apple ID payment method, by tapping an in-app button that opens device Settings -> Apple ID -> Payment and Shipping -> Add Payment Method.

Is it possible to program this functionality into a native iOS app? If so, where do I get started?

2 Answers

try this code:

    if let url = URL(string: "https://apps.apple.com/account/billing"), UIApplication.shared.canOpenURL(url) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    }
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
Related