Getting a hardware ID in JavaScript?

8,480 views
Skip to first unread message

Anthony Papillion

unread,
Jun 19, 2010, 7:27:08 PM6/19/10
to iphone...@googlegroups.com
This is my second question: does anyone know how to get a hardware ID
from the iPhone in JavaScript?
My webapp will be monetized and I need to make sure only one device is
logging into a particular account.

Any ideas?

--
Anthony Papillion

Lead Developer, ADCL, Inc.
1600 W. 12th St
Miami, OK 74354

Office: (918) 919-4624
Mobile: (918) 533-9699

"Quality software development and IT services"

Remi Grumeau

unread,
Jun 20, 2010, 12:28:29 AM6/20/10
to iphone...@googlegroups.com
I think you can't.
The only thing you can do is to tell your user to user their iPhone on first activation process, and store a variable on it (like a hash of the username+password) using localStorage databases. If the account is tagged as activate on your server-side and no databases key for it are stored on the phone, then it's not the same phone...

But no way to get the device ID using JS that i know of

R.

> --
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
>

Jesse MacFadyen

unread,
Jun 21, 2010, 3:00:48 AM6/21/10
to iphone...@googlegroups.com, iphone...@googlegroups.com
The deviceid is definitely NOT exposed via mobile safari. This would
be a huge security risk, imagine if every web advertiser could
identify you uniquely.

Cheers,
Jesse

Sent from my iPhone

Peter Rust

unread,
Jun 21, 2010, 12:47:24 PM6/21/10
to iphone...@googlegroups.com
A slightly different take on the "activation" of your webapp idea is to
store a unique ID in a cookie instead of localStorage. That should require
less coding and make it available automatically in every HTTP Request. The
problem with both is that they can "lose" their ID when/if they clear local
data, so you'll need to provide some way for the user to "re-activate" if
somehow their ID got cleared.

In my experience, it's best to keep this sort of code/process light and
simple. As long as it's not obviously easy to work around, most people will
be honest -- sort of a "keeping honest people honest" approach. It's usually
not worth the hassle to make it 100% bulletproof just to keep out the 1% of
users who are going to dig into your code to try to find a way around it...

-- peter rust

Reply all
Reply to author
Forward
0 new messages