-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FTUE - Msisdn (phone number) entry #6108
Conversation
0a13e9a
to
171056e
Compare
171056e
to
680b9a0
Compare
6d281ff
to
befcfe8
Compare
6fccd1c
to
666bf0e
Compare
ec6beae
to
ddbb64d
Compare
Not reviewed yet but if it's a draft because it depends on another PR, wouldn't it be better to set this one's destination to the branch of that pr and add a do not merge tag so this can be reviewed in isolation? |
@ericdecanini my bad, I had forgot to update the PR description, I promoted this from a draft because the dependent branch has been merged 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested, code looks fine
data class Success(val countryCode: String, val phoneNumber: String) : Result | ||
} | ||
|
||
private fun String.doesNotStartWith(input: String) = !startsWith(input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
ddbb64d
to
5857387
Compare
|
||
fun parseInternationalNumber(rawPhoneNumber: String): Result { | ||
return when { | ||
rawPhoneNumber.doesNotStartWith("+") -> Result.ErrorMissingInternationalCode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
International phone numbers can also start with "00" instead of "+". Perhaps we should check that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL
To avoid confusion especially in international context, a plus sign (+) is often used as a graphic symbol of the international access code; it informs the caller to replace it with the prefix code appropriate for their country.[3] Additionally, the GSM mobile telephony standard allows the use of the plus sign in place of the international call prefix; the mobile operator then automatically converts the plus sign to the correct international prefix, depending on the location where the phone is being used. This enables callers to use the same stored number when calling from any country.
https://en.wikipedia.org/wiki/International_call_prefix
tl;dr mobile networks automatically covert from + to the correct IDD prefix
we would have to support multiple variants of 00
, 011
etc which wouldn't scale too well and for the most part should be safe to replace with a +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah...... let's stick with the + 😂
5857387
to
bfa50f1
Compare
SonarCloud Quality Gate failed. |
Type of change
Content
Partly addresses #6043 - the confirmation screen is currently being designed and will be raised in a separate PR
Adds an updated styling version of the Phone number (Msisdn) entry
Motivation and context
To update the phone number entry flow
Screenshots / GIFs
Tests
Tested devices