I am working on an iPhone application where I need the user's phone number. From what I've read (here for instance - Programmatically get own phone number in iOS), the device's phone number is not available within your application's container. I've always had the user enter his or her own number. But when I joined GroupMe the other day, after clicking the Get Started button, my phone opened up a drafted text message to some US area code number "Send this text to verify your phone number(b2bd308eb7)" After I sent the text, the app knew my number....how does one implement a system like this?
Asked
Active
Viewed 1.2k times
2 Answers
9
What GroupMe does is use the MessageUI Framework ( http://developer.apple.com/library/ios/#DOCUMENTATION/MessageUI/Reference/MessageUI_Framework_Reference/_index.html) to send a text message to their servers.
Basically it works like this:
- The app is turned on and calls the server.
- The server responds with a code
b2bd308eb7
. - The app sends that code via SMS to the server.
- The server gets the code and your phone number (from SMS) and confirms them.
- Your phone number and app are connected!

James Paolantonio
- 2,194
- 1
- 15
- 32
-
what sort of service is the phone number that the text is sent to? It was a 267 area code phone number. – mistahenry Aug 14 '12 at 14:44
1
They send a text message to some service that they can query with their server. So by sending the code to the server, they can verify the number,

Kai Mattern
- 3,090
- 2
- 34
- 37
-
1I'm still confused on how to implement a service that the server can query. I understand the code part, but could elaborate on the how you would get the text message information (as in the phone number and the code) to the server? – mistahenry Aug 21 '12 at 14:08