Aws-sdk-ios: Sign In screen not fully rending

Created on 5 Nov 2018  路  2Comments  路  Source: aws-amplify/aws-sdk-ios

Describe the bug
I'm working with AWS Amplify on iOS to utilize the out of the box user authentication screens but unfortunately they are not fully rendering as shown below. I am using the code from the Amplify tutorial at https://docs.aws.amazon.com/aws-mobile/latest/developerguide/add-aws-mobile-user-sign-in.html. I'm using XCode 10 and I've tried numerous device emulators on v12 and v11.4 of iOS and they have all exhibited the same behavior. Has anyone else experienced this scenario? My code is included below:

To Reproduce
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)

    }

View code from where I try to launch the sign in screen

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)")
                                    }
            })
    }
}

Which AWS service(s) are affected?
UI Screens included

Expected behavior
I was expecting the full sign in screen to render

Screenshots
image

Environment(please complete the following information):

  • SDK Version: 2.6.33
  • Dependency Manager: Cocoapods
  • Swift Version : 4.0

Device Information (please complete the following information):

  • Device: Simulator or iOS 12.0 device
  • iOS Version: iOS 11.4 or 12.0
  • Specific to simulators:

Additional context

cognito question

All 2 comments

Hello @cdellinger

This would happen if you do not have any sign in providers in your awsconfiguration.json.

You need to add at least 1 sign-in provider among UserPools, Google or Facebook for the UI to render. Do you have any of these in your awsconfiguration.json file?

That was exactly it, I didn't have a section for CognitoUserPool. Thanks for your help, I greatly appreciate it.

Was this page helpful?
0 / 5 - 0 ratings