23
23
import com .firebase .ui .auth .choreographer .idp .provider .GoogleProvider ;
24
24
import com .firebase .ui .auth .choreographer .idp .provider .IDPProviderParcel ;
25
25
import com .firebase .ui .auth .ui .credentials .CredentialsInitActivity ;
26
+ import com .google .firebase .FirebaseApp ;
26
27
27
28
import java .util .ArrayList ;
28
29
import java .util .List ;
@@ -34,21 +35,23 @@ public class AuthFlowFactory {
34
35
/**
35
36
* Creates the intent that starts the auth flow
36
37
* @param context activity context
37
- * @param appName the app name of the FirebaseApp that you wish to use
38
- * @param apiaryKey the Firebase backend API key
39
- * @param applicationId the Firebase application id
40
- * @param providers the supported identity providers that you wish to enable (google, facebook, etc)
41
- * @return the Intent to start the auth flow
38
+ * @param firebaseApp the FirebaseApp that's to used for the authentication flow
39
+ * @param termsOfServiceUrl the URL to the Term of Service page to be present to the user
40
+ * @param theme the customized theme to be applied to the authentication flow. 0 will use the default theme.
41
+ * @param providers the supported identity providers that you wish to enable (google, facebook, etc)
42
+ * @return
42
43
*/
43
44
public static Intent createIntent (
45
+ // * @param providers the supported identity providers that you wish to enable (google, facebook, etc)
44
46
@ NonNull Context context ,
45
- @ NonNull String appName ,
46
- @ NonNull String apiaryKey ,
47
- @ NonNull String applicationId ,
47
+ @ NonNull FirebaseApp firebaseApp ,
48
48
String termsOfServiceUrl ,
49
49
int theme ,
50
50
@ Nullable List <String > providers ) {
51
51
ArrayList <IDPProviderParcel > providerParcels = new ArrayList <>();
52
+ String appName = firebaseApp .getName ();
53
+ String apiaryKey = firebaseApp .getOptions ().getApiKey ();
54
+ String applicationId = firebaseApp .getOptions ().getApplicationId ();
52
55
if (providers == null || providers .size () == 0 ) {
53
56
return CredentialsInitActivity .createIntent (
54
57
context ,
@@ -67,7 +70,7 @@ public static Intent createIntent(
67
70
context .getString (R .string .facebook_application_id )));
68
71
} else if (provider .equalsIgnoreCase ("google" )) {
69
72
providerParcels .add (
70
- GoogleProvider .createParcel (context . getString ( R . string . google_client_id )));
73
+ GoogleProvider .createParcel (firebaseApp . getOptions (). getApplicationId ( )));
71
74
}
72
75
}
73
76
return CredentialsInitActivity .createIntent (
0 commit comments