【问题标题】:ApplePay 'requiredShippingAddressFields' was deprecated in iOS 11.0ApplePay 'requiredShippingAddressFields' 在 iOS 11.0 中已弃用
【发布时间】:2020-01-07 15:15:46
【问题描述】:

在 IOS > 11 中设置/激活电子邮件、电话或邮政地址的最新方法是什么?

我尝试滚动浏览方法和属性,结果如下:paymentRequest.shippingType

这是旧方法:

paymentRequest.requiredShippingAddressFields = [.phone, .email, .postalAddress]

我想了解是否有一种方法可以比旧方法更容易编写代码并且不会引起警告。

【问题讨论】:

    标签: ios swift applepay


    【解决方案1】:

    【讨论】:

    • 那个链接没有提供一个有效的例子,所以我发现了这个:paymentRequest.requiredShippingAddressFields = PKAddressField.all
    • 这是新的响应...'PKAddressField' 在 iOS 11.0 中已弃用:使用 PKContactField 和 -requiredShippingContactFields / -requiredBillingContactFields
    • 知道了。这是目标c中的链接和答案。我不得不转换为swift。 Apple Pay 编程指南:创建支付请求:developer.apple.com/library/archive/ApplePay_Guide/…
    【解决方案2】:

    requiredShippingAddressFields 已弃用,请改用requiredBillingContactFields

    欲了解更多信息:documentation

    【讨论】:

      猜你喜欢
      • 2017-11-07
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      • 1970-01-01
      • 2018-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多