.subscriptionsAutoReconnect(subscriptionsAutoReconnect) .mutationQueueExecutionTimeout(30*1000) .persistentMutationsCallback(new PersistentMutationsCallback() { @Override public void onResponse(PersistentMutationsResponse response) {
.subscriptionsAutoReconnect(subscriptionsAutoReconnect) .mutationQueueExecutionTimeout(30*1000) .persistentMutationsCallback(new PersistentMutationsCallback() { @Override public void onResponse(PersistentMutationsResponse response) {
public synchronized static AWSAppSyncClient getInstance(Context context) { if (client == null) { client = AWSAppSyncClient.builder() .context(context) .apiKey(new BasicAPIKeyAuthProvider(Constants.APPSYNC_API_KEY)) // For use with IAM/Cognito authorization .region(Constants.APPSYNC_REGION) .serverUrl(Constants.APPSYNC_API_URL) .persistentMutationsCallback(new PersistentMutationsCallback() { @Override public void onResponse(PersistentMutationsResponse response) { Log.d("NOTERROR", response.getMutationClassName()); } @Override public void onFailure(PersistentMutationsError error) { Log.e("TAG", error.getMutationClassName()); Log.e("TAG", "Error", error.getException()); } }) .build(); } return client; } }
public synchronized static AWSAppSyncClient getInstance(Context context) { if (client == null) { // awsConfiguration = new AWSConfiguration(context); client = AWSAppSyncClient.builder() .context(context) .apiKey(new BasicAPIKeyAuthProvider(Constants.APPSYNC_API_KEY)) .serverUrl(Constants.APPSYNC_API_URL) .region(Constants.APPSYNC_REGION) .persistentMutationsCallback(new PersistentMutationsCallback() { @Override public void onResponse(PersistentMutationsResponse response) { Log.d("NOTERROR", response.getMutationClassName()); } @Override public void onFailure(PersistentMutationsError error) { Log.e("TAG", error.getMutationClassName()); Log.e("TAG", "Error", error.getException()); } }) .build(); } return client; }