简体   繁体   English

无法获取具有错误的远程视图控制器:错误:domain = _UIViewServiceInterfaceErrorDomain,code = 2

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

I have a really frustrating error. 我有一个非常令人沮丧的错误。 I'm 3 months into iOS development. 我进入iOS开发已有3个月了。 I've been logging into facebook and then connecting up to Firebase. 我一直在登录Facebook,然后连接到Firebase。 I implemented that right at the start. 我在一开始就实现了这一点。 It works perfectly, todays the day I wake up to put the app on the store... and the Facebook login doesn't work. 它工作得很好,今天我醒来把应用程序放在商店......并且Facebook登录不起作用。

Absolutely nothing has changed in my code for logging into Facebook(I'm almost certain but I've checked everything!) What happens is you will click the facebook login button and it will be nothing but white (where normally there would be an internet browser). 我登录Facebook的代码绝对没有任何改变(我几乎可以肯定,但我已经检查了一切!)你会点击facebook登录按钮,它将只是白色(通常会有互联网)浏览器)。 The error I get is: 我得到的错误是:

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

I have changed absolutely non of the code. 我完全改变了代码。 My bundleID and appID are the same as in the facebook developer. 我的bundleID和appID与facebook开发者中的相同。

I have absolutely no idea what it is and the very few people that have a similar problem don't seem to either. 我完全不知道它是什么,只有极少数有类似问题的人似乎也没有。 I'd like to understand but just being able to work around it and it not occur in the future would be really great! 我想明白,但只是能够解决它并且未来不会发生真的很棒! I am coding in swift but i'm not using the swiftSDK like in the Facebook docs, instead i'm using the FBSDKLoginButton. 我在swift编码,但我没有像在Facebook文档中那样使用swiftSDK,而是使用FBSDKLoginButton。

Also I have tried this on a simulator and it doesn't happen. 此外,我在模拟器上尝试了这一点,它不会发生。 It only happens on my phone. 它只发生在我的手机上。

I'm really not sure what is helpful information so I'm sorry if I include something not relevant. 我真的不确定什么是有用的信息,所以如果我包含一些不相关的内容,我很抱歉。

I'm using facebook sdk 4.20.2 我正在使用facebook sdk 4.20.2

This is my info.plist: 这是我的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>

This is my login VC: 这是我的登录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")
}
}

Then the login button is just a FBSDKLoginButton. 然后登录按钮只是一个FBSDKLoginButton。 When I look through the Facebook docs it doesn't explain doing it this way, instead it explains doing it with a swift SDK but I followed a guide setting up Facebook this way and didn't really understand it. 当我浏览Facebook文档时,它没有解释这样做,相反它解释了使用一个快速的SDK,但我遵循指南设置Facebook这种方式,并没有真正理解它。

Solution: clear data and history from Safari settings on your phone. 解决方案:从手机上的Safari设置中清除数据和历史记录。

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

I was have the same issue when thoroughly testing my login flow - logging in/out repeatedly, using the FB native app instead of Safari login, etc. 在彻底测试我的登录流程时遇到了同样的问题 - 重复登录/注销,使用FB本机应用程序而不是Safari登录等。

I guess this is a weakness in the interactions between FB login / Safari. 我想这是FB登录/ Safari之间交互的弱点。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AFHTTPRequestOperationManager获取请求失败,错误域= AFNetworkingErrorDomain代码= -1016 - AFHTTPRequestOperationManager Get request failed,Error Domain=AFNetworkingErrorDomain Code=-1016 _UIViewServiceInterfaceErrorDomain - _UIViewServiceInterfaceErrorDomain “ PBRequester失败,错误域= NSURLErrorDomain代码= -1000错误的URL” - “PBRequester failed with Error Error Domain=NSURLErrorDomain Code=-1000 ”bad URL" 加载失败,错误为 Error Domain=NSURLErrorDomain Code=-999“已取消” - load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" 无法获取令牌,错误:错误域 = NSCocoaErrorDomain 代码 = 3000 “没有为应用程序找到有效的 &#39;aps-environment&#39; 权利字符串” - Failed to get token, error: Error Domain=NSCocoaErrorDomain Code=3000 “no valid 'aps-environment' entitlement string found for application” 呈现:错误域= IDEFoundationErrorDomain代码= 1“无法为myApp编译bitcode: - Presenting: Error Domain=IDEFoundationErrorDomain Code=1 "failed to compile bitcode for myApp: Fabric无法下载设置Error Domain = FABNetworkError Code = -6 - Fabric failed to download settings Error Domain=FABNetworkError Code=-6 使用苹果登录抛出授权失败:错误域=AKAuthenticationError 代码=-7026 - Sign in with apple throws Authorization failed: Error Domain=AKAuthenticationError Code=-7026 谓词调用日历守护程序失败:错误域= EKCADErrorDomain代码= 1013 - Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 Fabric 无法下载设置 Error Domain=FABNetworkError Code=-5 - Fabric failed to download settings Error Domain=FABNetworkError Code=-5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM