-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample_MainActivity.java
More file actions
29 lines (23 loc) · 893 Bytes
/
Copy pathsample_MainActivity.java
File metadata and controls
29 lines (23 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package CUSTOM.PACKAGE.NAME;
import CUSTOM.PACKAGE.NAME.backend.CognitoManager;
import androidx.appcompat.app.AppCompatActivity;
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession;
import android.os.Bundle;
/**
* sample MainActivity class, very bare
*/
public class MainActivity extends AppCompatActivity {
public CognitoManager mCognitoManager;
@Override
protected void onCreate(Bundle savedInstanceState) { // called when app is started
mCognitoManager = new CognitoManager();
}
/**
* called after user is successfully logged in using Cognito
* necessary to user cognito to get credentials for S3
*/
public void PerformPostLoginSequence(CognitoUserSession usersession) {
mCognitoManager.user_session = usersession;
mCognitoManager.cognito_token = usersession.getIdToken().getJWTToken();
}
}