我在使用iber应用程序进行超级登录时遇到问题 . 我已尝试使用loginButton并单独使用loginManager .

当单独使用loginManager并使用.native loginType时,我收到“Error Domain = com.uber.rides-ios-sdk.ridesAuthenticationError Code = 13”

尝试使用loginButton时,它甚至都不会显示 . 我在控制台中获得了一个巨大的打印输出(如下图所示 . 无法正确显示粘贴的文本)

debug console errors after trying to add login button subview

我尝试从头开始创建一个新项目,并且我看到了loginButton和loginManager的相同行为(在修改App Signature以匹配新创建的项目之后) . 我使用的是Xcode 9,Swift 4.0和UberRides ios SDK 0.7.0

我在开发人员仪表板中检查了“配置文件”一般范围,并在iOS的“应用程序签名”部分下添加了我的捆绑包标识符

以下是我添加到Info.plist中的信息:

<key>UberClientID</key>
<string>[removed]</string>
<key>UberDisplayName</key>
<string>[removed]</string>
<key>UberServerToken</key>
<string>[removed]</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>uber</string>
    <string>uberauth</string>
</array>
<key>UberCallbackURIs</key>
<array>
    <dict>
        <key>UberCallbackURIType</key>
        <string>Native</string>
        <key>URIString</key>
        <string>[removed bundle identifier]://oauth/consumer</string>
    </dict>
</array>
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>[removed bundle identifier]</string>
        </array>
    </dict>
</array>

这是我的loginButton的代码(我还创建了视图控制器,我在LoginButtonDelegate中实现了这个代码,并添加了两个必要的函数(didLogoutWithSuccess和didCompleteLoginWithToken),以允许视图控制器充当委托)

let scopes: [RidesScope] = [.profile]
    let loginManager = LoginManager(loginType: .native)
    let loginButton = LoginButton(frame: CGRect.zero, scopes: scopes, loginManager: loginManager)
    loginButton.presentingViewController = self
    loginButton.delegate = self
    loginButton.center = self.view.center
    self.view.addSubview(loginButton)

这是我用来尝试使用登录管理器的代码(我在尝试实现登录按钮时已对此进行了评论):

let loginManager = LoginManager(loginType: .native)
        loginManager.login(requestedScopes:[RidesScope.profile], presentingViewController: self, completion: { accessToken, error in
            // Completion block. If accessToken is non-nil, you’re good to go
            // Otherwise, error.code corresponds to the RidesAuthenticationErrorType that occured

            let ridesClient = RidesClient()
            ridesClient.fetchUserProfile(completion: {profile, response in
                if let error = response.error{
                    // handle error
                    print(error.code)
                }
                if let profile = profile{
                    // do something with profile

                }
            })

        })

如果您需要任何其他信息,请与我们联系 . 提前致谢!