3

I'm using mobile hub and Amazon Cognito to authenticate user by using Facebook provider. Once use login with Facebook I need to check if this is first time login to the app or not. If it is first time I need to get some information and if it is already sign-up to the app I need to get some information related to the user from dynamoDB. I was wondering what would be the best way to find out if user login to the app for the first time.

#import <AWSMobileHubHelper/AWSMobileHubHelper.h>

@implementation UserIdentityAccess

- (NSString *)getUserIdentity {
    return [AWSIdentityManager defaultIdentityManager].identityId;
}
4

1 回答 1

1

如果您已经在使用 Dynamo 来存储用户元数据,那么您可能会使用它来存储标识 id x 之前是否见过的标志。

或者,可以在此处使用 Cognito Sync。您可以在数据集中放置一条记录来跟踪它是否已经被看到,然后检查它是否存在。这带来的一个好处是它为您将其存储在身份 ID 上,因此您不必自己处理身份 ID 到数据映射。此处提供有关 Cognito 同步的更多信息。

于 2016-10-12T17:21:30.740 回答