相机权限
在点击扫描时说明理由(Android Developers, n.d.;Felt et al., 2012),原则同通知权限请求。
取景与反馈
显示取景框和手电筒(Google, n.d.;Apple, n.d.;MDN, n.d.),以触觉反馈确认成功。
安全与替代
先显示域名(Kieseberg et al., 2010),实现防错设计,并提供手动输入(WCAG 2.2 4.1.3)。
常见问题
- 何时请求权限?
- 首次扫描时并说明理由。
- 没有相机也能用吗?
- 提供手动输入等替代。
来源核查日期:2026-10-27
参考文献
- Google. (n.d.). Barcode scanning. ML Kit. 识别条件。
- Apple. (n.d.). DataScannerViewController. VisionKit documentation. iOS内置扫描器。
- MDN Web Docs. (n.d.). MediaDevices: getUserMedia() method. 网页相机访问。
- Android Developers. (n.d.). Request runtime permissions. 在情境中请求权限。
- Felt, A. P., Ha, E., Egelman, S., Haney, A., Chin, E., & Wagner, D. (2012). Android permissions: User attention, comprehension, and behavior. In Proceedings of the Eighth Symposium on Usable Privacy and Security (pp. 1–14). ACM. 用户难以理解权限。
- Kieseberg, P., Leithner, M., Mulazzani, M., Munroe, L., Schrittwieser, S., Sinha, M., & Weippl, E. (2010). QR code security. In Proceedings of the 8th International Conference on Advances in Mobile Computing and Multimedia (pp. 430–435). ACM. 恶意二维码风险。
- World Wide Web Consortium. (2023). Web Content Accessibility Guidelines (WCAG) 2.2. 1.1.1与4.1.3标准。
