Paul
Paul

Reputation: 3152

How do I query a Windows Phone 7 phone number via API?

Quick question that I can't find an answer to...

How do you find what the number of the phone running Windows Phone 7 is?

For example, in the UK the number would start with 447*. I need this information to send to our server so it can send the user a text message when something has happened.

Upvotes: 1

Views: 1085

Answers (4)

Its not available directly; but if you definitely need the phone number and you are providing a useful service that the user is interested in, then just ask the user to provide their phone number.

You can validate if the user has entered the number along with country code by looking at the location and determining the country code from a lookup table/ web service.

Upvotes: 0

Lee Armstrong
Lee Armstrong

Reputation: 11450

It is not available with the API, nor any private methods.

This is also not in the Mango release as far as I am aware.

Upvotes: 0

keyboardP
keyboardP

Reputation: 69372

Do you mean the phone's actual number or the country code? +44 is the UK international code. If you mean the phone number, I don't think this is possible. In Mango, you can get the Mobile Operator. Mobile operators tend to have their own first few digits, so you could store a table of those and check it against the operator returned. It may not be wholly accurate, but might be useful if you can get a list of numbers of prefix major operators.

Upvotes: 1

Peter J
Peter J

Reputation: 57967

As far as I know, phone number is not available via the API.

Upvotes: 1

Related Questions