微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

AppAuth 的弃用警告

如何解决AppAuth 的弃用警告

我收到了一些警告消息。其中大部分在更新相关 Pod 后消失了。但是这3个警告仍然存在。我没有 AppAuth pod,但有 Firebase/Auth 和 Firebase/Core。我应该怎么做才能摆脱它们?

谢谢,

下面是 Podfile。

==========================

# Uncomment the next line to define a global platform for your project
platform :ios,'10.0'

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
  end

target ‘test’ do
  # Comment the next line if you don't want to use dynamic frameworks
    use_frameworks!
  # use_modular_headers!

  # Pods for test

    pod 'Firebase'
    pod 'Firebase/Core'
    pod 'Firebase/Auth'
    pod 'GoogleSignIn'

    pod 'Firebase/Firestore'
    pod 'Firebase/Storage'

    pod 'Firebase/Crashlytics'
    pod 'Firebase/Analytics'

    pod 'Firebase/DynamicLinks'
    pod 'Firebase/Performance'

    pod 'FBSDKCoreKit'
    pod 'FBSDKLoginKit'

  target ‘testTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target ‘testUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

enter image description here

enter image description here

解决方法

AppAuthdependency of GoogleSignIn 及以上的 designed to work on iOS 7

通过删除最低 iOS 版本 7 将 Podfile 的 post_install 脚本中的版本更改为 10 会导致警告。

您可以通过将最低版本更改为 9 来消除警告和 Xcode 12 警告,而不是删除它,因为不支持 iOS 8:

post_install do |pi|
    pi.pods_project.targets.each do |t|
      t.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
end

感谢 https://stackoverflow.com/a/58367269/556617 提供 post_install 脚本。

,

如 Xcode 所示,它已被弃用,因此请使用此新方法而不是 openUrl

open func open(_ url: URL,options: [String : Any] = [:],completionHandler completion: (@escaping (Bool) -> Swift.Void)? = nil)

如果你发现两个新参数有默认值:一个空字典和一个可选的 nil 闭包。这就是为什么您可以轻松地将其用作 openUrl

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。