Reputation: 281445
Is it possible for a web application to obtain a name for the iPad it's being used on?
I don't mean "iPad" vs. "iPhone", I mean "Richie's iPad" or similar.
Imagine a web app where you can log in from multiple devices, with a page that lists the devices you're logged in from: "You are logged in from Richie's iPad".
(On the server side I could look up the network name of the device's IP address, but that's likely not to be very user-friendly, and will fail unless it's on a simple intranet with no proxies, no VPNs etc.)
Upvotes: 2
Views: 355
Reputation: 26683
The only way to get this kind of information as a web app is via Over-the-Air Profile Delivery Enrollment. You can see a good example of this in action at TestFlight.
For details on implementation, check out Apple's very badly explained documentation. I found it easier to reverse-engineer TestFlight then to follow the docs.
The way this works is, user gets a Provisioning Profile install screen (you might have seen this if you installed some custom wifi configuration or any other profiles) that asks them if they want to allow your website to access device's information, and which information specifically. You pick what information you want (device name, type, iOS version, etc.), and if user approves, profile will be installed to their device (Settings -> General -> Profiles ... safe to delete if you only want to access this data once and store it in cookie or html5 database storage) you will get a request back to server with that info.
SSL certificate is not really required for the part you need, but is highly recommended as user will get a big red unverified warning on the profile install prompt page.
Upvotes: 2