在网络应用程序中为特定 iPad 获取有意义的名称
Web 应用程序是否可以获取正在使用的 iPad 的名称?
我的意思不是“iPad”与“iPhone”,我的意思是“Richie's iPad”或类似的。
想象一下您可以从多个设备登录的 Web 应用程序,其中的页面列出了您登录的设备:“您已从 Richie 的 iPad 登录”。
(在服务器端,我可以查找设备 IP 地址的网络名称,但这可能不太用户友好,并且会失败,除非它位于没有代理、没有 VPN 等的简单 Intranet 上。)
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为网络应用程序获取此类信息的唯一方法是通过无线配置文件交付注册。您可以在 TestFlight 上看到一个很好的示例。
有关实施的详细信息,请查看 Apple 的
其工作原理是,用户会看到一个配置文件安装屏幕(如果您安装了一些自定义 WiFi 配置或任何其他配置文件,您可能会看到此屏幕),询问他们是否允许您的网站访问设备信息,以及具体哪些信息。您选择所需的信息(设备名称、类型、iOS 版本等),如果用户批准,配置文件将安装到他们的设备上(设置 -> 常规 -> 配置文件...可以安全删除,如果您只如果您想访问一次该数据并将其存储在 cookie 或 html5 数据库存储中)您将收到一个包含该信息的请求返回服务器。
对于您需要的部分来说,SSL 证书并不是真正必需的,但强烈建议您这样做,因为用户将在配置文件安装提示页面上收到大红色未经验证警告。
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.