本文整理汇总了Java中com.firebase.ui.auth.AuthUI.SupportedProvider方法的典型用法代码示例。如果您正苦于以下问题:Java AuthUI.SupportedProvider方法的具体用法?Java AuthUI.SupportedProvider怎么用?Java AuthUI.SupportedProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.firebase.ui.auth.AuthUI
的用法示例。
在下文中一共展示了AuthUI.SupportedProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: providerIdToAccountType
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
/**
* Translate a Firebase Auth provider ID (such as {@link GoogleAuthProvider#PROVIDER_ID}) to a
* Credentials API account type (such as {@link IdentityProviders#GOOGLE}).
*/
public static String providerIdToAccountType(@AuthUI.SupportedProvider @NonNull String providerId) {
switch (providerId) {
case GoogleAuthProvider.PROVIDER_ID:
return IdentityProviders.GOOGLE;
case FacebookAuthProvider.PROVIDER_ID:
return IdentityProviders.FACEBOOK;
case TwitterAuthProvider.PROVIDER_ID:
return IdentityProviders.TWITTER;
case PhoneAuthProvider.PROVIDER_ID:
return PHONE_IDENTITY;
// The account type for email/password creds is null
case EmailAuthProvider.PROVIDER_ID:
default:
return null;
}
}
示例2: accountTypeToProviderId
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
@AuthUI.SupportedProvider
public static String accountTypeToProviderId(@NonNull String accountType) {
switch (accountType) {
case IdentityProviders.GOOGLE:
return GoogleAuthProvider.PROVIDER_ID;
case IdentityProviders.FACEBOOK:
return FacebookAuthProvider.PROVIDER_ID;
case IdentityProviders.TWITTER:
return TwitterAuthProvider.PROVIDER_ID;
case PHONE_IDENTITY:
return PhoneAuthProvider.PROVIDER_ID;
default:
return null;
}
}
示例3: 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;
}
示例4: getProviderId
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
@NonNull
@AuthUI.SupportedProvider
public String getProviderId() {
return mProviderId;
}
示例5: Builder
import com.firebase.ui.auth.AuthUI; //导入方法依赖的package包/类
public Builder(@AuthUI.SupportedProvider @NonNull String providerId,
@Nullable String email) {
mProviderId = providerId;
mEmail = email;
}