How to detect devices (Android, iOS, windows) in AMP website

我只是一个虾纸丫 提交于 2020-01-05 04:04:10

问题


I have made a website in AMP (Accelerated Mobile Pages). I want to show some content in android but not in iOS.
Is there any way to detect android and iOS using AMP?


回答1:


You can use amp-access for this, You have to identify user-agent in authorization and set a flag. here is an example which does that. In the example device-detection checks if the device is android otherwise returns Iphone



来源:https://stackoverflow.com/questions/54039020/how-to-detect-devices-android-ios-windows-in-amp-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!