amplify-android icon indicating copy to clipboard operation
amplify-android copied to clipboard

How could I use mutiple Amplify in single project?

Open mengshuaishuai opened this issue 3 years ago • 3 comments
trafficstars

Before opening, please confirm:

Language and Async Model

Java, Kotlin

Amplify Categories

GraphQL API, DataStore

Gradle script dependencies

dependencies {

implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

//  Amplify core dependency
api 'com.amplifyframework:aws-datastore:1.37.3'
api 'com.amplifyframework:core:1.37.3'
api 'com.amplifyframework:aws-api:1.37.3'

}

Environment information


Gradle 7.3.3

Build time: 2021-12-22 12:37:54 UTC Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71

Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 1.8.0_311 (Oracle Corporation 25.311-b11) OS: Mac OS X 10.12.6 x86_64

Please include any relevant guides or documentation you're referencing

No response

Describe the feature request

I got two Amplify app with different models, I want to use both of them in my Android app, how should I do?

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line


Additional information and screenshots

No response

mengshuaishuai avatar Sep 19 '22 03:09 mengshuaishuai

Hi @mengshuaishuai 👋🏼 I'm having problems inferring your question here, could you be more specific about "multiple Amplify" ? Are you looking answers for multiple backends for your single Amplify project ? If yes, please refer to this comment here: https://github.com/aws-amplify/learn/issues/293#issuecomment-904766037 Thank you!

manaswi223 avatar Oct 13 '22 18:10 manaswi223

Hi I am also interested in this issue.

When building a fairly large amplify project, you may want to manage separate backends for each feature.

One problem is that cloudformation template size is limited to 1MB.

Therefore, I would like to seamlessly access another backend from a frontend app that cooperates with each backend.

Since the application is developed in monorepo, it is an image that each workspace has an amplify backend directory.

I would like to know how to achieve this.

rnrnstar2 avatar Dec 14 '22 02:12 rnrnstar2

Hello @rnrnstar2 -- we do not currently support this feature. It may be possible to use the workaround linked above https://github.com/aws-amplify/learn/issues/293#issuecomment-904766037, as the limitation against using cookies seems to be applicable to JS-based solutions such as React Native. On Android applications of course you can use something like SharedPreferences to communicate between the various backends. However, you may run into other issues when attempting to do so.

We can take a feature request to provide a more comprehensive approach to this multiple-backend use case, but unfortunately cannot share any timeline details.

tjleing avatar Dec 15 '22 17:12 tjleing