Skip to content

Commit 5c78b88

Browse files
committed
Merge remote-tracking branch 'upstream/version-4.1.0-dev' into tests
2 parents 8832dbd + 6f5f8c5 commit 5c78b88

File tree

96 files changed

+171
-615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+171
-615
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ libraries.
4747
```groovy
4848
dependencies {
4949
// FirebaseUI for Firebase Realtime Database
50-
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
50+
implementation 'com.firebaseui:firebase-ui-database:4.0.1'
5151
5252
// FirebaseUI for Cloud Firestore
53-
implementation 'com.firebaseui:firebase-ui-firestore:4.0.0'
53+
implementation 'com.firebaseui:firebase-ui-firestore:4.0.1'
5454
5555
// FirebaseUI for Firebase Auth
56-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
56+
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
5757
5858
// FirebaseUI for Cloud Storage
59-
implementation 'com.firebaseui:firebase-ui-storage:4.0.0'
59+
implementation 'com.firebaseui:firebase-ui-storage:4.0.1'
6060
}
6161
```
6262

@@ -206,7 +206,7 @@ repositories {
206206
Then you can depend on snapshot versions:
207207

208208
```groovy
209-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0-SNAPSHOT'
209+
implementation 'com.firebaseui:firebase-ui-auth:x.y.z-SNAPSHOT'
210210
```
211211

212212
You can see which `SNAPSHOT` builds are avaiable here:

auth/README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Gradle, add the dependency:
6363
```groovy
6464
dependencies {
6565
// ...
66-
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
66+
implementation 'com.firebaseui:firebase-ui-auth:4.0.1'
6767
6868
// Required only if Facebook login support is required
6969
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
@@ -291,6 +291,7 @@ startActivityForResult(
291291

292292
##### Phone number authentication customization
293293

294+
###### Setting a default phone number
294295
When using the phone verification provider and the number is known in advance, it is possible to
295296
provide a default phone number (in international format) that will be used to prepopulate the
296297
country code and phone number input fields. The user is still able to edit the number if desired.
@@ -301,7 +302,7 @@ IdpConfig phoneConfigWithDefaultNumber = new IdpConfig.PhoneBuilder()
301302
.build();
302303
```
303304

304-
Alternatively, you can set only the default phone number country.
305+
Alternatively, you can set the default country (alpha-2 format) to be shown in the country selector.
305306

306307
```java
307308
IdpConfig phoneConfigWithDefaultNumber = new IdpConfig.PhoneBuilder()
@@ -319,6 +320,45 @@ IdpConfig phoneConfigWithDefaultNumber = new IdpConfig.PhoneBuilder()
319320
.build();
320321
```
321322

323+
###### Limiting the list of available countries in the country selector
324+
325+
You can limit the countries shown in the country selector list. By default, all countries are shown.
326+
327+
You can provide a list of countries to whitelist or blacklist. You can populate these lists with
328+
ISO (alpha-2) and E164 formatted country codes.
329+
330+
```java
331+
List<String> whitelistedCountries = new ArrayList<String>();
332+
whitelistedCountries.add("+1");
333+
whitelistedCountries.add("gr");
334+
335+
IdpConfig phoneConfigWithWhitelistedCountries = new IdpConfig.PhoneBuilder()
336+
.setWhitelistedCountries(whitelistedCountries)
337+
.build();
338+
```
339+
All countries with the country code +1 will be present in the selector as well as Greece ('gr').
340+
341+
You may want to exclude a few countries from the list and avoid creating a whitelist with
342+
many countries. You can instead provide a list of countries to blacklist. By doing so, all countries
343+
excluding the ones you provide will be in the selector.
344+
345+
```java
346+
List<String> blacklistedCountries = new ArrayList<String>();
347+
blacklistedCountries.add("+1");
348+
blacklistedCountries.add("gr");
349+
350+
IdpConfig phoneConfigWithBlacklistedCountries = new IdpConfig.PhoneBuilder()
351+
.setBlacklistedCountries(blacklistedCountries)
352+
.build();
353+
```
354+
355+
The country code selector will exclude all countries with a country code of +1 and Greece ('gr').
356+
357+
Note: You can't provide both a list of countries to whitelist and blacklist. If you do, a runtime
358+
exception will be thrown.
359+
360+
#####
361+
322362
### Handling the sign-in response
323363

324364
#### Response codes

auth/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ android {
1111

1212
lintOptions {
1313
disable("UnusedQuantity")
14+
disable("MissingTranslation") // TODO: Translate fui_auto_verified
1415
}
1516

1617
testOptions {

auth/src/main/java/com/firebase/ui/auth/data/client/CountryListLoadTask.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ public interface Listener {
5050
Set<String> whitelistedCountryIsos;
5151
Set<String> blacklistedCountryIsos;
5252

53-
public CountryListLoadTask(Listener listener,
54-
@Nullable List<String> whitelistedCountries,
55-
@Nullable List<String> blacklistedCountries) {
53+
public CountryListLoadTask(@Nullable List<String> whitelistedCountries,
54+
@Nullable List<String> blacklistedCountries,
55+
Listener listener) {
5656
mListener = listener;
5757

5858
if (whitelistedCountries != null) {

auth/src/main/java/com/firebase/ui/auth/ui/phone/CountryListSpinner.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ public void onClick(View view) {
148148
}
149149

150150
private void loadCountryList() {
151-
new CountryListLoadTask(this,
152-
whitelistedCountries,
153-
blacklistedCountries).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
151+
new CountryListLoadTask(whitelistedCountries, blacklistedCountries, this
152+
).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
154153
}
155154

156155
private void executeUserClickListener(View view) {

auth/src/main/java/com/firebase/ui/auth/ui/phone/PhoneActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected void onFailure(@NonNull Exception e) {
7979
protected void onSuccess(@NonNull PhoneVerification verification) {
8080
if (verification.isAutoVerified()) {
8181
Toast.makeText(
82-
PhoneActivity.this, R.string.fui_verified, Toast.LENGTH_LONG).show();
82+
PhoneActivity.this, R.string.fui_auto_verified, Toast.LENGTH_LONG).show();
8383
}
8484

8585
handler.startSignIn(verification.getCredential(), new IdpResponse.Builder(

auth/src/main/res/values-ar/strings.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@
4949
<string name="fui_resend_code_in">إعادة إرسال الرمز بعد 0:%02d</string>
5050
<string name="fui_verify_your_phone_title">إثبات ملكية رقم هاتفك</string>
5151
<string name="fui_verifying">جارٍ التحقق…</string>
52-
<string name="fui_retrieving_sms">جارٍ استرداد الرسائل القصيرة SMS…</string>
5352
<string name="fui_incorrect_code_dialog_body">الرمز غير صحيح. يُرجى المحاولة مجددًا.</string>
54-
<string name="fui_incorrect_code_dialog_positive_button_text">موافق</string>
5553
<string name="fui_error_too_many_attempts">تم استخدام رقم الهاتف هذا لعدد كبير جدًا من المرات</string>
5654
<string name="fui_error_quota_exceeded">حدثت مشكلة أثناء إثبات ملكية رقم هاتفك</string>
5755
<string name="fui_error_session_expired">لم يعد هذا الرمز صالحًا</string>
5856
<string name="fui_sign_in_with_phone_number">تسجيل الدخول عبر رقم الهاتف</string>
59-
<string name="fui_done">تم</string>
60-
<string name="fui_verified">اكتملت عملية إثبات الملكية!</string>
61-
<string name="fui_code_sent">تم إرسال الرمز!</string>
62-
<string name="fui_resending">جارٍ إعادة الإرسال…</string>
6357
<string name="fui_resend_code">إعادة إرسال الرمز</string>
6458
<string name="fui_verify_phone_number">تأكيد ملكية رقم الهاتف</string>
6559
<string name="fui_continue_phone_login">متابعة</string>

auth/src/main/res/values-b+es+419/strings.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@
4949
<string name="fui_resend_code_in">Se reenviará el código en 0:%02d</string>
5050
<string name="fui_verify_your_phone_title">Verifica tu número de teléfono</string>
5151
<string name="fui_verifying">Verificando…</string>
52-
<string name="fui_retrieving_sms">Recuperando SMS…</string>
5352
<string name="fui_incorrect_code_dialog_body">Código incorrecto. Vuelve a intentarlo.</string>
54-
<string name="fui_incorrect_code_dialog_positive_button_text">Aceptar</string>
5553
<string name="fui_error_too_many_attempts">Este número de teléfono se usó demasiadas veces</string>
5654
<string name="fui_error_quota_exceeded">Ocurrió un problema durante la verificación de tu número de teléfono</string>
5755
<string name="fui_error_session_expired">Este código ya no es válido</string>
5856
<string name="fui_sign_in_with_phone_number">Acceder con el número de teléfono</string>
59-
<string name="fui_done">Listo</string>
60-
<string name="fui_verified">¡Verificado!</string>
61-
<string name="fui_code_sent">Se envió el código.</string>
62-
<string name="fui_resending">Reenviando…</string>
6357
<string name="fui_resend_code">Reenviar código</string>
6458
<string name="fui_verify_phone_number">Verificar número de teléfono</string>
6559
<string name="fui_continue_phone_login">Continuar</string>

auth/src/main/res/values-bg/strings.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@
4949
<string name="fui_resend_code_in">Повторно изпращане на кода след 0:%02d</string>
5050
<string name="fui_verify_your_phone_title">Потвърждаване на телефонния ви номер</string>
5151
<string name="fui_verifying">Потвърждава се…</string>
52-
<string name="fui_retrieving_sms">SMS съобщението се извлича…</string>
5352
<string name="fui_incorrect_code_dialog_body">Неправилен код. Опитайте отново.</string>
54-
<string name="fui_incorrect_code_dialog_positive_button_text">ОК</string>
5553
<string name="fui_error_too_many_attempts">Този телефонен номер е използван твърде много пъти</string>
5654
<string name="fui_error_quota_exceeded">При потвърждаването на телефонния ви номер възникна проблем</string>
5755
<string name="fui_error_session_expired">Този код вече не е валиден</string>
5856
<string name="fui_sign_in_with_phone_number">Вход с телефонен номер</string>
59-
<string name="fui_done">Готово</string>
60-
<string name="fui_verified">Потвърдено!</string>
61-
<string name="fui_code_sent">Кодът е изпратен!</string>
62-
<string name="fui_resending">Изпраща се повторно…</string>
6357
<string name="fui_resend_code">Повторно изпращане на кода</string>
6458
<string name="fui_verify_phone_number">Потвърждаване на телефонния номер</string>
6559
<string name="fui_continue_phone_login">Напред</string>

auth/src/main/res/values-bn/strings.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@
4949
<string name="fui_resend_code_in">0:%02d এ কোডটি আবার পাঠান</string>
5050
<string name="fui_verify_your_phone_title">আপনার ফোন নম্বর যাচাই করুন</string>
5151
<string name="fui_verifying">যাচাই করা হচ্ছে…</string>
52-
<string name="fui_retrieving_sms">এসএমএসটি পুনরুদ্ধার করা হচ্ছে…</string>
5352
<string name="fui_incorrect_code_dialog_body">কোডটি ভুল। আবার চেষ্টা করুন।</string>
54-
<string name="fui_incorrect_code_dialog_positive_button_text">ঠিক আছে</string>
5553
<string name="fui_error_too_many_attempts">এই ফোন নম্বরটি অনেকবার ব্যবহার করা হয়েছে</string>
5654
<string name="fui_error_quota_exceeded">আপনার ফোন নম্বরটি যাচাই করতে সমস্যা হয়েছে</string>
5755
<string name="fui_error_session_expired">এই কোডটি আর ব্যবহার করা যাবে না</string>
5856
<string name="fui_sign_in_with_phone_number">ফোন নম্বর দিয়ে সাইন-ইন করুন</string>
59-
<string name="fui_done">সম্পন্ন হয়েছে</string>
60-
<string name="fui_verified">যাচাই করা হয়েছে!</string>
61-
<string name="fui_code_sent">কোডটি পাঠানো হয়েছে!</string>
62-
<string name="fui_resending">আবার পাঠানো হচ্ছে…</string>
6357
<string name="fui_resend_code">কোডটি আবার পাঠান</string>
6458
<string name="fui_verify_phone_number">ফোন নম্বর যাচাই করুন</string>
6559
<string name="fui_continue_phone_login">চালিয়ে যান</string>

0 commit comments

Comments
 (0)