简体   繁体   English

如何检测用户是否在 PHP 或 Jquery 中使用 Apple 设备 [不仅是 iOS]

[英]How to detect if user is using an Apple device [Not only iOS] in PHP or Jquery

I am trying to detect if a user is using an Apple device, this is because I am trying to integrate Apple pay on my software, and I don't want to show android users Apple pay option.我正在尝试检测用户是否正在使用 Apple 设备,这是因为我正在尝试将 Apple Pay 集成到我的软件中,我不想向 android 用户显示 Apple Pay 选项。 They say using USER agent can be used but can also be spoofed, is there a more secure method.他们说用USER agent可以用但是也可以被欺骗,请问有没有更安全的方法。

I saw this answer我看到了这个答案

Detecting iOS / Android Operating system . 检测 iOS / Android 操作系统 I dont want just iOS device as iOS doesnt run on Macbook我不想要 iOS 设备,因为 iOS 不能在 Macbook 上运行

AND

Detect Apple Device Model . 检测 Apple 设备 Model But it is on Objective C但它在目标 C 上

AND

Detect if user is using an iDevice . 检测用户是否正在使用 iDevice It did not answer the question.它没有回答问题。

From Apple's website :来自Apple 的网站

if (window.ApplePaySession) {
   // The Apple Pay JS API is available.
}

After doing that you can also detect if they have a at least one card provisioned using canMakePaymentsWithActiveCard这样做之后,您还可以检测他们是否至少有一张使用canMakePaymentsWithActiveCard配置的卡

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM