1
votes

I guess my question is two fold:

  1. Does AWS mobile hub supports cognito sync? I have downloaded and looked into their sample app but I can only see the sign in part
  2. If yes, how do I get a "dataset"? The user pool created by mobile hub doesn't even have "identity browser" said on this page

If I use mobile hub to login, can I pod AWSCognito myself and use cognito sync?

Thanks a lot

1

1 Answers

0
votes

Mobile Hub does support Cognito sync. You can demo this feature by enabling the User Data Storage feature in your Mobile Hub project, then downloading the sample app.

The User Data Storage feature will also integrate with the Sign In feature if it is enabled in your project.

To retrieve the Cognito dataset, see the example inside the sample application (folder: Demo > UserSettings) or you can explicitly do the following:

let syncClient: AWSCognito = AWSCognito.default()
let userSettings: AWSCognitoDataset = syncClient.openOrCreateDataset("user_settings")
userSettings.setString(<value>, forKey: <key>)
userSettings.synchronize()

There are also platform specific instructions in the integrate page of your Mobile Hub project.