简体   繁体   English

AWS Cognito检查和恢复会话(iOS)

[英]AWS Cognito check and resume session (iOS)

I'm using Amazon Cognito with MobileHub on iOS. 我在iOS上将Amazon Cognito与MobileHub结合使用。 I've spent the whole day figuring out how to check and resume a session to make the login seamless. 我花了一整天的时间弄清楚如何检查和恢复会话以使登录无缝。

I was able to sign in and sign up users but to make them open the app and the app checking the session (to see if they're not logged out/user was disabled from the user pool) and then if everything passes they're automatically logged in - this I can't figure out. 我能够登录并注册用户,但让他们打开应用程序并检查会话的应用程序(以查看他们是否未注销/从用户池中禁用了用户),然后一切顺利自动登录-我无法确定。 The docs are not at all helpful and I've tried using resumeSession and other random methods but nothing is working. 该文档根本没有帮助,我已经尝试过使用resumeSession和其他随机方法,但是没有任何效果。

The resume session should be called from your app delegate's didFinishLaunchingWithOptions method. 应从您的应用程序委托的didFinishLaunchingWithOptions方法调用恢复会话。 Mobile Hub does this in the AWSMobileClient.swift file with callbacks from your app delegate. Mobile Hub在AWSMobileClient.swift文件中通过应用程序委托的回调来执行此操作。 You can follow the getting started instructions on Mobile Hub console to integrate the AWSMobileClient.swift file. 您可以按照Mobile Hub控制台上的入门说明进行操作,以集成AWSMobileClient.swift文件。 This file could be located in the AmazonAws folde of the sample app or minimal SDK which you download. 该文件可以位于您下载的示例应用程序或最小SDK的AmazonAws文件夹中。

Thanks, Rohan 谢谢,罗汉

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM