ios - 放大 iOS 登录屏幕不呈现控件

标签 ios aws-amplify

我正在 iOS 上使用 AWS Amplify 来利用开箱即用的用户身份验证屏幕,但遗憾的是它们没有完全呈现,如下所示。我正在使用位于 https://docs.aws.amazon.com/aws-mobile/latest/developerguide/add-aws-mobile-user-sign-in.html 的 Amplify 教程中的代码.我正在使用 XCode 10,我在 iOS 的 v12 和 v11.4 上尝试过许多设备模拟器,它们都表现出相同的行为。还有其他人经历过这种情况吗?我的代码如下:

Podfile

platform :ios, '12.0'

target 'TestApp1' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestApp1
  pod 'AWSCore', '~> 2.6.33'
  pod 'AWSPinpoint', '~> 2.6.33'
  pod 'AWSMobileClient', '~> 2.6.33'
  pod 'AWSUserPoolsSignIn', '~> 2.6.33'
  pod 'AWSAuthUI', '~> 2.6.33'

end

AppDelegate.swift

import AWSPinpoint
import AWSMobileClient

...

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Create AWSMobileClient to connect with AWS
        return AWSMobileClient.sharedInstance().interceptApplication(application, didFinishLaunchingWithOptions: launchOptions)
    }

    func application(_ application: UIApplication, open url: URL,
                     sourceApplication: String?, annotation: Any) -> Bool {

        return AWSMobileClient.sharedInstance().interceptApplication(
            application, open: url,
            sourceApplication: sourceApplication,
            annotation: annotation)

    }

查看我尝试启动登录屏幕的代码

import AWSCore
import AWSMobileClient
import AWSAuthCore
import AWSAuthUI

...

override func viewDidLoad() {
    super.viewDidLoad()
    showSignIn()
}

func showSignIn() {
    if !AWSSignInManager.sharedInstance().isLoggedIn {
        AWSAuthUIViewController
            .presentViewController(with: self.navigationController!,
                                   configuration: nil,
                                   completionHandler: { (provider: AWSSignInProvider, error: Error?) in
                                    if error != nil {
                                        print("Error occurred: \(String(describing: error))")
                                    } else {
                                        print("Identity provider: \(provider.identityProviderName)")
                                    }
            })
    }
}

Screen Print of Emulator

最佳答案

这个问题在 GitHub 上得到了回答 https://github.com/aws/aws-sdk-ios/issues/1082一位名叫 rohandubal 的绅士。问题是我的 awsconfiguration.json 文件没有 CognitoUserPool 的配置信息。

关于ios - 放大 iOS 登录屏幕不呈现控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53159392/

相关文章:

aws-amplify - AWS 放大 : How to switch aws profile that amplify env is pointing to

javascript - 区域缺失错误 - AWS Amplify React

azure - 如何将 amplify 中的 azure 存储库集成到 CI/CD 中?

reactjs - AWS Amplify - React Authenticator 组件不可见

ios - 设置UIImageView图像后多次调用CFRunLoopRun

ios - 无法在 iOS 中通过 HTML5 视频与内容交互

iphone - 以编程方式从 iPhone 发送短信

ios - 在 UIScrollView 中自动调整 UITextView 的大小

ios - `UnsafeMutablePointer.initialize()`到底是做什么的?

javascript - 无法编译 - Expo Web - 安装 UI-Kitten 后