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

Time:03-22

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. They say using USER agent can be used but can also be spoofed, is there a more secure method.

I saw this answer

Detecting iOS / Android Operating system . I dont want just iOS device as iOS doesnt run on Macbook

AND

Detect Apple Device Model . But it is on Objective C

AND

Detect if user is using an iDevice . It did not answer the question.

CodePudding user response:

From Apple’s website:

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

  • Related