I just want to download selective data based on user sub id but Amplify is allowing me to run the configure command once, selective syncing is used for this purpose, I am using amplify signin method and getting the sub id from it, I just want to fetch the data based on that sub id but I have to re-configure the Amplify so that will be based on that sub id but for Amplify Auth service Amplify is already configured and I am not able to add configuration based on sub id
Here is the code that I am using in my application class
/* Add the Amplify Plugins */
Amplify.addPlugin(AWSApiPlugin())
Amplify.addPlugin(AWSCognitoAuthPlugin())
Amplify.addPlugin(AWSDataStorePlugin.builder().dataStoreConfiguration(
DataStoreConfiguration.builder()
.syncExpression(Rooms::class.java) { Devices.SUB.ge(AwsConstants.AMPLIFY_SUB_ID) }
.syncExpression(Scenes::class.java) { Devices.SUB.ge(AwsConstants.AMPLIFY_SUB_ID) }
.syncExpression(Devices::class.java) { Devices.SUB.ge(AwsConstants.AMPLIFY_SUB_ID) }
.syncExpression(Automations::class.java) { Devices.SUB.ge(AwsConstants.AMPLIFY_SUB_ID) }
.syncExpression(MasterNodes::class.java) { Devices.SUB.ge(AwsConstants.AMPLIFY_SUB_ID) }
.build()
).build())
Amplify.configure(applicationContext)
I just want to add the configuration to downlaod the selective data before getting the data ready
/* Starting the DataStore Syncing */
Amplify.DataStore.start(
{ Log.i(Constants.TAG_AMPLIFY, "DataStore started") },
{}
)