本文整理汇总了Java中com.firebase.ui.auth.AuthUI.IdpConfig方法的典型用法代码示例。如果您正苦于以下问题:Java AuthUI.IdpConfig方法的具体用法?Java AuthUI.IdpConfig怎么用?Java AuthUI.IdpConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.firebase.ui.auth.AuthUI
的用法示例。
在下文中一共展示了AuthUI.IdpConfig方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startSignInProcess
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
public void startSignInProcess() {
if (!checkGooglePlayServices()) {
return;
}
FirebaseAuth auth = FirebaseAuth.getInstance();
if (auth.getCurrentUser() != null) {
RxBus.INSTANCE.post(new SnackbarRequest(new SnackbarBundle(getString(R.string.sign_in_successful))));
} else {
ArrayList<AuthUI.IdpConfig> providers = new ArrayList<>();
providers.add(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build());
providers.add(new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());
startActivityForResult(
// Get an instance of AuthUI based on the default app
AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(providers)
.setLogo(R.drawable.logo)
.setTosUrl("https://github.com/jamieadkins95/Yennefr/blob/master/TOS.md")
.setIsSmartLockEnabled(!BuildConfig.DEBUG)
.setTheme(R.style.Theme_Gwent)
.build(),
REQUEST_CODE_SIGN_IN);
}
}
示例2: startLoginWithFirebaseUI
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
private void startLoginWithFirebaseUI() {
List<AuthUI.IdpConfig> providers = new ArrayList<>();
providers.add(new AuthUI.IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build());
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.build(), RC_SIGN_IN);
}
示例3: requestSignIn
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
public static void requestSignIn(FragmentActivity activity) {
List<AuthUI.IdpConfig> idpConfigs = Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build());
activity.startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(idpConfigs)
.setTheme(R.style.AppTheme)
.setLogo(R.mipmap.ic_launcher_round)
.setAllowNewEmailAccounts(true)
.setIsSmartLockEnabled(false)
.build(),
RC_SIGN_IN);
}
示例4: FacebookProvider
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
public FacebookProvider(AuthUI.IdpConfig idpConfig, @StyleRes int theme) {
List<String> scopes = idpConfig.getScopes();
if (scopes == null) {
mScopes = new ArrayList<>();
} else {
mScopes = scopes;
}
WebDialog.setWebDialogTheme(theme);
}
示例5: startLogin
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
@Override
public void startLogin(Activity activity) {
Bundle params = null;
for (AuthUI.IdpConfig idpConfig : mFlowParameters.providerInfo) {
if (idpConfig.getProviderId().equals(AuthUI.PHONE_VERIFICATION_PROVIDER)) {
params = idpConfig.getParams();
}
}
activity.startActivityForResult(
PhoneActivity.createIntent(activity, mFlowParameters, params),
RC_PHONE_FLOW);
}
示例6: onCreate
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSaveSmartLock = getAuthHelper().getSaveSmartLockInstance(mActivity);
User user = User.getUser(getArguments());
String provider = user.getProviderId();
AuthUI.IdpConfig providerConfig = null;
for (AuthUI.IdpConfig config : getFlowParams().providerInfo) {
if (config.getProviderId().equalsIgnoreCase(provider)) {
providerConfig = config;
break;
}
}
if (providerConfig == null) {
// we don't have a provider to handle this
finish(Activity.RESULT_CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR));
return;
}
if (provider.equalsIgnoreCase(GoogleAuthProvider.PROVIDER_ID)) {
mIdpProvider = new GoogleProvider(
getActivity(),
providerConfig,
user.getEmail());
} else if (provider.equalsIgnoreCase(FacebookAuthProvider.PROVIDER_ID)) {
mIdpProvider = new FacebookProvider(providerConfig, getFlowParams().themeId);
} else if (provider.equalsIgnoreCase(TwitterAuthProvider.PROVIDER_ID)) {
mIdpProvider = new TwitterProvider(getContext());
}
mIdpProvider.setAuthenticationCallback(this);
if (savedInstanceState == null) {
mIdpProvider.startLogin(getActivity());
}
}
示例7: getSupportedAccountTypes
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
private List<String> getSupportedAccountTypes() {
List<String> accounts = new ArrayList<>();
for (AuthUI.IdpConfig idpConfig : getFlowParams().providerInfo) {
@AuthUI.SupportedProvider String providerId = idpConfig.getProviderId();
if (providerId.equals(GoogleAuthProvider.PROVIDER_ID)
|| providerId.equals(FacebookAuthProvider.PROVIDER_ID)
|| providerId.equals(TwitterAuthProvider.PROVIDER_ID)) {
accounts.add(ProviderUtils.providerIdToAccountType(providerId));
}
}
return accounts;
}
示例8: startAuthMethodChoice
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
private void startAuthMethodChoice() {
FlowParameters flowParams = getFlowParams();
List<AuthUI.IdpConfig> idpConfigs = flowParams.providerInfo;
// If there is only one provider selected, launch the flow directly
if (idpConfigs.size() == 1) {
AuthUI.IdpConfig firstIdpConfig = idpConfigs.get(0);
String firstProvider = firstIdpConfig.getProviderId();
switch (firstProvider) {
case EmailAuthProvider.PROVIDER_ID:
// Go directly to email flow
startActivityForResult(
EmailActivity.createIntent(getContext(), flowParams),
RC_EMAIL_FLOW);
break;
case PhoneAuthProvider.PROVIDER_ID:
// Go directly to phone flow
Bundle params = firstIdpConfig.getParams();
Intent phoneActivityIntent = PhoneActivity
.createIntent(getContext(), flowParams, params);
startActivityForResult(
phoneActivityIntent,
RC_PHONE_FLOW);
break;
default:
// Launch IDP flow
redirectToIdpSignIn(null, ProviderUtils.providerIdToAccountType(firstProvider));
break;
}
} else {
startActivityForResult(
AuthMethodPickerActivity.createIntent(
getContext(),
flowParams),
RC_AUTH_METHOD_PICKER);
}
getDialogHolder().dismissDialog();
}
示例9: __constructor__
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
@SuppressWarnings("checkstyle:methodname")
public void __constructor__(AuthUI.IdpConfig idpConfig, @StyleRes int theme) {}