Comments (3)
Hi @Trivoc ,
You will need to call AWSMobileClient.getInstance().initialize(Context, Callback<UserStateDetails>)
before making calls to any of the other functions.
Also, for the showSignIn
there is a requirement to pass in the options for now. (We will look into fixing it in a release.)
AWSMobileClient.getInstance().showSignIn(this, SignInUIOptions.builder()
.logo(R.drawable.default_sign_in_logo) // This logo is available through the library
.backgroundColor(R.color.colorPrimaryDark) // This color should be generic to Android, but you may choose another
.canCancel(true)
.build(), new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails userStateDetails) {
Log.d(TAG, "onResult: showSignIn " + userStateDetails.getUserState());
}
@Override
public void onError(Exception e) {
Log.e(TAG, "onError: showSignIn", e);
}
});
from docs.
Hello @Trivoc,
Issue has been fixed
#179 (comment)
Please review.
from docs.
Hello,
Thank you for the update. Attempting the new snippet resulted in a thrown exception with trace:
W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference
at com.amazonaws.mobile.client.AWSMobileClient.getSignInDetailsMap(AWSMobileClient.java:566)
at com.amazonaws.mobile.client.AWSMobileClient.getUserStateDetails(AWSMobileClient.java:583)
at com.amazonaws.mobile.client.AWSMobileClient$19.run(AWSMobileClient.java:1907)
at com.amazonaws.mobile.client.internal.InternalCallback.await(InternalCallback.java:106)
at com.amazonaws.mobile.client.AWSMobileClient.showSignIn(AWSMobileClient.java:1896)
at com.example.trivoc.testaws.MainActivity.onCreate(MainActivity.java:43)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
from docs.
Related Issues (20)
- mistake monorepo root path
- How to use Amplify datastore in Ionic/Capacitor project?
- Fix S3 bucket policy example to prevent "action does not apply to any resources in statement" error
- Gen 2 Quickstart guide: having to refresh browser to see updates HOT 1
- Event Bridge example with L2 Rule construct instead of L1 Cfn HOT 3
- Gen 2 Quickstart guide: missing `npm install` when setting up local environment HOT 1
- Gen 2 Quickstart guide: add section on deleting app
- Update improper text regarding cacheControl changes in v6
- Default name for GRAPHQL_ENDPOINT is incorrect
- Migrating DataStore to Gen 2
- Amplify Gen 2 Angular Documentation needs updates
- Reference to Amplify Studio in Gen 2 docs
- Clarify amplify-admin local AWS setup profile
- Remove hosting documentation for unrelated platforms HOT 2
- improve signUp API docs to clearly state options that can be passed in
- Example Sample repos for configuring lambda functions (via amplify), with different runtimes (Python, Java, etc.)
- Middleware example does not always handle the response object
- Amplify Gen 2 Documentation for Custom Subscription Client-Side Swift/iOS
- Allow guest access example wrong variable
- Add Hosting and Deployment documentation for Flutter Web
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.