简体   繁体   中英

iOS : Detect SIRI Device

How do I identify the device has SIRI or not?

I was trying to use, [[UIDevice currentDevice] systemVersion] which returns me iOS version 6.0.

Some devices can have same the iOS version but have the different capability of SIRI.

Which is the best solution to identify SIRI devices?

You can detect the device, instead of the iOS version.

The currently supported devices so far are:

  • iPhone (4S and later)
  • iPod Touch (5th generation)
  • iPad (3rd generation and later)
  • iPad Mini (All generations)

so I would just write down a blacklist of unsupported devices and detect them.

In order to do so, you can use the approaches described here

In this case, I couldn't find any official API using a quick Google search, but as always, feature detection is superior to version detection. So here's what I did, not sure if this is allowed in the App Store:

 BOOL hasSiri = [[NSFileManager defaultManager] fileExistsAtPath:@"/System/Library/Assistant"];

Try this to get Device details

[[UIDevice currentDevice] platformType] // ex: UIDevice4GiPhone

[[UIDevice currentDevice] platformString] // ex: @"iPhone 4G"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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