簡體   English   中英

Firebase(電話驗證)獲取 iOS 錯誤:注冊自定義 URL 方案

[英]Firebase (Phone Auth) Getting iOS error: register custom URL scheme

我的 flutter 應用程序使用 Firebase Auth(電話)。 我一直看到錯誤: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx'

我已將 URL 架構添加到 info.plist 中,如下所示,但我遇到了同樣的錯誤。

在此處輸入圖像描述

2020-04-29 20:40:05.173962-0400 Runner[395:20944] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please register custom URL scheme 'com.googleusercontent.apps.602546125958-5lk04ghhdfj5xxxxxxxx' in the app's Info.plist file.'
*** First throw call stack:
(0x1889035f0 0x188625bcc 0x1887f9b28 0x10086cfa8 0x100f056a0 0x102efb3b0 0x102e921bc 0x102eeb9cc 0x102ea2a68 0x102ea4dcc 0x1888821c0 0x188881edc 0x1888815b8 0x18887c5c8 0x18887bc34 0x1929c538c 0x18c9ae22c 0x10082addc 0x188703800)
libc++abi.dylib: terminating with uncaught exception of type NSException

刪除你 URL 從.plist 文件中輸入條目並按照步驟操作,將自動生成.plist 條目。

這也適用於 Flutter

腳步:

在此處輸入圖像描述

如果要添加超過 1 個 URL 方案,可以單擊 URL 類型中的 +。

如果您有任何問題,請發表評論。

樂意效勞!

iOS 電話驗證設置有一個 Firebase 文檔:

要啟用 Firebase SDK 以使用 reCAPTCHA 驗證:

將自定義 URL 方案添加到您的 Xcode 項目:

  1. 打開您的項目配置:雙擊左側樹視圖中的項目名稱。 Select 您的應用從 TARGETS 部分,然后 select Info 選項卡,並展開 URL Types 部分。
  2. 單擊 + 按鈕,並為您的反向客戶端 ID 添加 URL 方案。 要查找此值,請打開 GoogleService-Info.plist 配置文件,然后查找 REVERSED_CLIENT_ID 鍵。 復制該鍵的值,並將其粘貼到配置頁面上的 URL 方案框中。 將其他字段留空。 完成后,您的配置應類似於以下內容(但使用特定於應用程序的值):

https://firebase.google.com/docs/auth/ios/phone-auth?authuser=0

也適用於 Flutter。

我有同樣的問題。 嘗試以下設置。

在此處輸入圖像描述

我的問題是我將GoogleService-info.plist復制到了錯誤的目錄中。 有一個以您的應用程序命名的頂級文件夾,以及一個同名的文件夾,在該文件夾 就像MyApp/MyApp一樣,它需要在第二個內部文件夾中。

在 url 啟動器中添加反向客戶端 ID。

Reverse client id is located in googleservies.infolist xcode and copy the url and paste the url in url launcher by add the link

您需要在應用程序的 Info.plist 文件中注冊自定義 URL 方案。

將此行添加到您的 info.plist

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleIdentifier</key>
        <string></string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>enter your custom URL scheme here</string>
        </array>
    </dict>
</array>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM