I’ve looked through the APIs and am unable to find where you can retrieve the iPhone phone number. Is this hiding in plain sight or is it not possible? [import]uid: 59670 topic_id: 16808 reply_id: 316808[/import]
not possible as of now. and also it is in forgotten items list in corona roadmap. But I hope we can see that soon… [import]uid: 71210 topic_id: 16808 reply_id: 63008[/import]
Thanks for the info. This is amazing that such a simple basic function was left out. I’m porting my Android over to the iPhone platform and the phone number is used for registering so it’s an important part. Guess I’ll have to dig into Objective C which I was hoping to avoid. Glad I didn’t buy before finding this out.
[import]uid: 59670 topic_id: 16808 reply_id: 63015[/import]
That’s a shame.
Still, unless Apple have changed their terms you wont actually be able to get that app approved. Although you can find ways to get a number if the owner has either entered it in their phone or in iTunes when registering their device, it actually violates Apple’s T.O.S.
Peach [import]uid: 52491 topic_id: 16808 reply_id: 63245[/import]
well said Peach. so that means he won’t be able to do it even with Objective C. Right ? [import]uid: 71210 topic_id: 16808 reply_id: 63256[/import]
There are ways he could potentially get the number with Objective C, however it would still violate Apple’s terms. (To the best of my knowledge, they may have changed but I doubt it in that department, honestly.) [import]uid: 52491 topic_id: 16808 reply_id: 63281[/import]
Why not give them a text box and have them enter in their number…
If they don’t know it, well … maybe they shouldn’t have a phone [import]uid: 52430 topic_id: 16808 reply_id: 63282[/import]
What are you saying Jon? I don’t know my number [import]uid: 52491 topic_id: 16808 reply_id: 63293[/import]
@peach try calling any of your friends and ask them to read out the number showing in their screen. it works sometimes for me [import]uid: 71210 topic_id: 16808 reply_id: 63296[/import]
If you just need to get a unique ID for the phone to be used for registration purposes you could use
system.getInfo( "deviceID" )
This will give the UDID which is unique for every device.
Note that as of iOS5 it’s been deprecated, but it’s safe to use for now. There are other ways for generating a unique ID, for example a UUID. Corona doesn’t have built-in support for generating UUID’s yet, however there is a simple routine written by a fellow Corona user:
http://developer.anscamobile.com/code/uuidguid-string-generator-coronalua
[import]uid: 70847 topic_id: 16808 reply_id: 63313[/import]
@Peach - Thanks for the heads up. The phone number is a integral part of my app registration. When the user registers the app, their phone number is stored in a MySql db on my server. This way if they change phones they won’t have to register the app again. Plus it keeps someone from trying to register one app more then once. The phone number is also part of a security feature. I could use a simple entry box for the user to enter their number but I would need to figure out a way to verify it.
A couple of more questions:
Are you able to access the contact list? I need the user to be able to select from that list.
Are you able to send SMS messages without user intervention?
Thanks for the help. I would prefer to use Corona if all possible. [import]uid: 59670 topic_id: 16808 reply_id: 63317[/import]
Hey again,
Apologies on the delayed response - I was traveling back to Australia and thus offline.
No worries RE the heads up - I understand this throws somewhat of a spanner into things for you and I hope you can find a way around that, possibly having the user input their own number.
As to accessing the contact list and sending SMS, no, not yet - it’s something that I believe (don’t quote me) is planned for some stage, however it is not yet available.
Corona is still growing into certain elements of utilities rather than games and although it has come a long, long way very quickly it still has a way to go.
That said, Corona IS a fantastic SDK, the best for most things - and I say that as a developer. I might be part of team Ansca, but only because I fell so in love with the SDK that they couldn’t not hire me
Whichever SDK you end up needing for your app I do hope you’ll keep an eye on Corona - it is constantly improving and everyone works ridiculously hard to make sure it stays that way. (If you’re interested, see http://Techority.com/ - the latest post relates to this.)
Hope I’ve been able to help,
Peach [import]uid: 52491 topic_id: 16808 reply_id: 63710[/import]