如何在 Firebase/Auth 上避免 UIWebView

Posted

技术标签:

【中文标题】如何在 Firebase/Auth 上避免 UIWebView【英文标题】:How to avoid UIWebView on Firebase/Auth 【发布时间】:2020-05-06 15:56:18 【问题描述】:

我需要获取 UIWebView 已被 WKWebView 替换的 Firebase/Auth 版本

由于使用 UIWebView 而被 AppStore 拒绝后,我正在尝试更新到未使用它的 Firebase pod 版本。但是在 pod update、pod install、pod deintegrate ... Firebase/Auth 版本之后,我可以获得 Firebase/Auth (5.20.2): 仍在使用 UIWebView 所以我怎样才能更新到最新版本或任何不使用 UIWebView 的版本 在我的 Podfile 和 Podfile.lock 下方

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

#target 'globa_jap-desktop' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for globa_jap-desktop

#end

target 'globa_jap-mobile' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!
 pod 'Firebase/Core'
 pod 'Firebase/Auth'
 pod 'Firebase/Messaging'
 pod 'Firebase/Database'
 pod 'Fabric'
 pod 'Crashlytics'
 #Login UI pods
 pod 'FirebaseUI/Google'
 pod 'FirebaseUI/Twitter'

end

Podfile.lock

PODS:
  - Crashlytics (3.14.0):
    - Fabric (~> 1.10.2)
  - Fabric (1.10.2)
  - Firebase/Auth (5.20.2):
    - Firebase/CoreOnly
    - FirebaseAuth (= 5.4.2)
  - Firebase/Core (5.20.2):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.8.1)
  - Firebase/CoreOnly (5.20.2):
    - FirebaseCore (= 5.4.1)
  - Firebase/Database (5.20.2):
    - Firebase/CoreOnly
    - FirebaseDatabase (= 5.1.1)
  - Firebase/Messaging (5.20.2):
    - Firebase/CoreOnly
    - FirebaseMessaging (= 3.5.0)
  - FirebaseAnalytics (5.8.1):
    - FirebaseCore (~> 5.4)
    - FirebaseInstanceID (~> 3.8)
    - GoogleAppMeasurement (= 5.8.1)
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - FirebaseAnalyticsInterop (1.5.0)
  - FirebaseAuth (5.4.2):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.2)
    - GoogleUtilities/Environment (~> 5.2)
    - GTMSessionFetcher/Core (~> 1.1)
  - FirebaseAuthInterop (1.1.0)
  - FirebaseCore (5.4.1):
    - GoogleUtilities/Environment (~> 5.2)
    - GoogleUtilities/Logger (~> 5.2)
  - FirebaseDatabase (5.1.1):
    - FirebaseAuthInterop (~> 1.0)
    - FirebaseCore (~> 5.2)
    - leveldb-library (~> 1.18)
  - FirebaseInstanceID (3.8.1):
    - FirebaseCore (~> 5.2)
    - GoogleUtilities/Environment (~> 5.2)
    - GoogleUtilities/UserDefaults (~> 5.2)
  - FirebaseMessaging (3.5.0):
    - FirebaseAnalyticsInterop (~> 1.1)
    - FirebaseCore (~> 5.2)
    - FirebaseInstanceID (~> 3.6)
    - GoogleUtilities/Environment (~> 5.3)
    - GoogleUtilities/Reachability (~> 5.3)
    - GoogleUtilities/UserDefaults (~> 5.3)
    - Protobuf (~> 3.1)
  - FirebaseUI/Auth (6.2.1):
    - Firebase/Auth (~> 5.0)
    - GoogleUtilities/UserDefaults
  - FirebaseUI/Google (6.2.1):
    - FirebaseUI/Auth
    - GoogleSignIn (~> 4.0)
  - FirebaseUI/Twitter (6.2.1):
    - FirebaseUI/Auth
    - TwitterKit (~> 3.0)
  - GoogleAppMeasurement (5.8.1):
    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
    - GoogleUtilities/MethodSwizzler (~> 5.2)
    - GoogleUtilities/Network (~> 5.2)
    - "GoogleUtilities/NSData+zlib (~> 5.2)"
    - nanopb (~> 0.3)
  - GoogleSignIn (4.4.0):
    - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
    - "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
    - GTMSessionFetcher/Core (~> 1.1)
  - GoogleToolboxForMac/DebugUtils (2.2.2):
    - GoogleToolboxForMac/Defines (= 2.2.2)
  - GoogleToolboxForMac/Defines (2.2.2)
  - "GoogleToolboxForMac/NSDictionary+URLArguments (2.2.2)":
    - GoogleToolboxForMac/DebugUtils (= 2.2.2)
    - GoogleToolboxForMac/Defines (= 2.2.2)
    - "GoogleToolboxForMac/NSString+URLArguments (= 2.2.2)"
  - "GoogleToolboxForMac/NSString+URLArguments (2.2.2)"
  - GoogleUtilities/AppDelegateSwizzler (5.8.0):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (5.8.0)
  - GoogleUtilities/Logger (5.8.0):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (5.8.0):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (5.8.0):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (5.8.0)"
  - GoogleUtilities/Reachability (5.8.0):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (5.8.0):
    - GoogleUtilities/Logger
  - GTMSessionFetcher/Core (1.4.0)
  - leveldb-library (1.22)
  - nanopb (0.3.9011):
    - nanopb/decode (= 0.3.9011)
    - nanopb/encode (= 0.3.9011)
  - nanopb/decode (0.3.9011)
  - nanopb/encode (0.3.9011)
  - Protobuf (3.11.4)
  - TwitterCore (3.2.0)
  - TwitterKit (3.4.2):
    - TwitterCore (>= 3.2.0)

DEPENDENCIES:
  - Crashlytics
  - Fabric
  - Firebase/Auth
  - Firebase/Core
  - Firebase/Database
  - Firebase/Messaging
  - FirebaseUI/Google
  - FirebaseUI/Twitter

SPEC REPOS:
  trunk:
    - Crashlytics
    - Fabric
    - Firebase
    - FirebaseAnalytics
    - FirebaseAnalyticsInterop
    - FirebaseAuth
    - FirebaseAuthInterop
    - FirebaseCore
    - FirebaseDatabase
    - FirebaseInstanceID
    - FirebaseMessaging
    - FirebaseUI
    - GoogleAppMeasurement
    - GoogleSignIn
    - GoogleToolboxForMac
    - GoogleUtilities
    - GTMSessionFetcher
    - leveldb-library
    - nanopb
    - Protobuf
    - TwitterCore
    - TwitterKit

SPEC CHECKSUMS:
  Crashlytics: 540b7e5f5da5a042647227a5e3ac51d85eed06df
  Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74
  Firebase: 0c8cf33f266410c61ab3e2265cfa412200351d9c
  FirebaseAnalytics: ece1aa57a4f43c64d53a648b5a5e05151aae947b
  FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae
  FirebaseAuth: dd7bbf03a5aee0eafb3a1aee4d2812bd74bac890
  FirebaseAuthInterop: a0f37ae05833af156e72028f648d313f7e7592e9
  FirebaseCore: f1a9a8be1aee4bf71a2fc0f4096df6788bdfda61
  FirebaseDatabase: 2c15b0ea6f2c6eb5e57413f9d6340f1e50b81ae3
  FirebaseInstanceID: a122b0c258720cf250551bb2bedf48c699f80d90
  FirebaseMessaging: 4235f949ce1c4e827aeb19705ba5c53f9b85aa10
  FirebaseUI: c9e227a7d44e2e422a461cb3f4ead8dc5c7326e6
  GoogleAppMeasurement: ffe513e90551844a739e7bcbb1d2aca1c28a4338
  GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39
  GoogleToolboxForMac: 800648f8b3127618c1b59c7f97684427630c5ea3
  GoogleUtilities: 04fce34bcd5620c1ee76fb79172105c74a4df335
  GTMSessionFetcher: 6f5c8abbab8a9bce4bb3f057e317728ec6182b10
  leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7
  nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
  Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
  TwitterCore: 8cbc9ad34d91c63a0035ea05bfbfc0d7ca72a28c
  TwitterKit: 5e4f41d70b9abdb41df5467f52d7aa2c0fd26ebb

PODFILE CHECKSUM: cb6d407f7cb8b554f5566b911add079a3c3c3021

COCOAPODS: 1.9.1

我尝试在 Podfile 中设置 Firebase/Auth 的版本,但由于与其他 pod 不兼容而失败

我最后一次尝试是直接从 git 获取最新版本的 FirebaseCore pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'

但失败并显示以下消息

[!] CocoaPods could not find compatible versions for pod "GoogleUtilities/Logger":
  In Podfile:
    FirebaseCore (from `https://github.com/firebase/firebase-ios-sdk.git`, branch `master`) was resolved to 6.7.0, which depends on
      GoogleUtilities/Logger (~> 6.5)

    FirebaseUI/Twitter was resolved to 6.2.1, which depends on
      FirebaseUI/Auth (= 6.2.1) was resolved to 6.2.1, which depends on
        GoogleUtilities/UserDefaults was resolved to 5.8.0, which depends on
          GoogleUtilities/Logger (= 5.8.0)

任何帮助谢谢!

使用 Xcode 11.3.1

【问题讨论】:

你有解决办法吗?? 对不起,我刚刚接受了正确答案。这对我有用 【参考方案1】:

我在 Firebase 的一个非常旧的结账处卡了很长时间,并在尝试上传我的应用程序时遇到了 UIWebView 已弃用。在终端上,我去了项目文件夹并做了:

pod repo update
pod deintegrate
gem install cocoa pods

然后运行我的 podfile 并获得最新的 Firebase Core 6.7.1。但是,我收到有关缺少包含文件的错误消息。我最终更改了该行以获取此标签:

pod 'Firebase/Core', '~> 6.7.0'

这就解决了问题。这里没有 UIWebVew 参考:

Using FirebaseAuth (6.2.3)

【讨论】:

以上是关于如何在 Firebase/Auth 上避免 UIWebView的主要内容,如果未能解决你的问题,请参考以下文章

Firebase Auth - 自定义声明的用户列表

如何在 firebase-functions 中使用 firebase.auth()?

如何使用firebase auth android无法返回android

如何根据 Firebase Auth 错误消息在 Flutter 中显示自定义警报对话框?

您好,我是 Flutter 新手,仍在练习基础知识。我想学习如何在不使用 firebase auth 的情况下在登录页面上设置默认凭据

我如何生成使用Firebase Auth的签名APK?]