A
A
alexey-tihonenko2017-09-13 07:11:36
JavaScript
alexey-tihonenko, 2017-09-13 07:11:36

How to find out the phone number of a user's SIM card on ios / android?

Please tell me, is it possible to somehow find out the phone number of the SIM card of the current user (with his permission) in the browser of a mobile device?
For example, there is a registration form. The form has a field for a phone number. The user does not fill in this field himself, but it is filled in automatically using JS - the phone number of the SIM card inserted into the user's phone is substituted there.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Smithson, 2017-09-13
@Smithson

There is an object in android called TelephonyManager . This is where you can get the information you need. If the user gives permission.
It is clear that no JS and other external programs will get access to it, only the software installed on the phone.

A
Alexey Lebedev, 2017-09-13
@swanrnd

Well, who would want such a function when they went to some site, the number was inserted into a transparent field and then went to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question