Can a mobile web application access the devices phone number?

前端 未结 1 590
名媛妹妹
名媛妹妹 2021-01-26 08:18

In say, mobile Safari, can I get the device\'s phone number? Presumably this would prompt the user if its allowed like it does with location.

相关标签:
1条回答
  • 2021-01-26 08:40

    It is possible in some cases that the number is sent through in a header from the network operator themselves. (i.e. you won't see it via wifi)

    Different operators use different headers:

    e.g.

    • X-UP-CALLING-LINE-ID (Vodacom South Africa)
    • x-up-subno (Google Adsense's Mobile code snippet looks at this amongst others)

    Some Device ID headers that might contain the MSIDSN of the user.

    • x-dcmguid
    • x-up-subno
    • x-jphone-uid
    • x-em-uid

    There are a bunch more here: http://mobiforge.com/developing/blog/useful-x-headers

    You will have to look at your target market (what network they typically come from) to know which headers will cover the most users for you.

    0 讨论(0)
提交回复
热议问题