簡體   English   中英

無法獲取具有錯誤的遠程視圖控制器:錯誤:domain = _UIViewServiceInterfaceErrorDomain,code = 2

[英]Failed to get remote view controller with error: Error: domain=_UIViewServiceInterfaceErrorDomain, code=2

我有一個非常令人沮喪的錯誤。 我進入iOS開發已有3個月了。 我一直在登錄Facebook,然后連接到Firebase。 我在一開始就實現了這一點。 它工作得很好,今天我醒來把應用程序放在商店......並且Facebook登錄不起作用。

我登錄Facebook的代碼絕對沒有任何改變(我幾乎可以肯定,但我已經檢查了一切!)你會點擊facebook登錄按鈕,它將只是白色(通常會有互聯網)瀏覽器)。 我得到的錯誤是:

[ViewService] Failed to get remote view controller with error: Error: domain=_UIViewServiceInterfaceErrorDomain, code=2

我完全改變了代碼。 我的bundleID和appID與facebook開發者中的相同。

我完全不知道它是什么,只有極少數有類似問題的人似乎也沒有。 我想明白,但只是能夠解決它並且未來不會發生真的很棒! 我在swift編碼,但我沒有像在Facebook文檔中那樣使用swiftSDK,而是使用FBSDKLoginButton。

此外,我在模擬器上嘗試了這一點,它不會發生。 它只發生在我的手機上。

我真的不確定什么是有用的信息,所以如果我包含一些不相關的內容,我很抱歉。

我正在使用facebook sdk 4.20.2

這是我的info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>CeleBreak</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb1253394891414659</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>FacebookAppID</key>
    <string>1253394891414659</string>
    <key>FacebookDisplayName</key>
    <string>CelebreakApp</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbauth2</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSAllowsArbitraryLoadsInWebContent</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict/>
    </dict>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
</dict>
</plist>

這是我的登錄VC:

class LoginVC: UIViewController: FBSDKLoginButtonDelegate {
@IBOutlet weak var loginButton: FBSDKLoginButton!

public var originVC: UIViewController = TabBarController()

override func viewDidLoad(){
    phoneNumberTextField.delegate = self
    loginButton.delegate = self
    phoneNumberTextField.keyboardType = UIKeyboardType.numberPad
}
func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error?) {

}
func loginButtonDidLogOut(_ loginButton: FBSDKLoginButton!) {
    fatalError("Logging out in Login View shouldn't happen")
}
}

然后登錄按鈕只是一個FBSDKLoginButton。 當我瀏覽Facebook文檔時,它沒有解釋這樣做,相反它解釋了使用一個快速的SDK,但我遵循指南設置Facebook這種方式,並沒有真正理解它。

解決方案:從手機上的Safari設置中清除數據和歷史記錄。

信用: https//stackoverflow.com/a/44457044/7442549

在徹底測試我的登錄流程時遇到了同樣的問題 - 重復登錄/注銷,使用FB本機應用程序而不是Safari登錄等。

我想這是FB登錄/ Safari之間交互的弱點。

暫無
暫無

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

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