sto*_*cis 3 iphone ios apple-watch
我想知道是否有可用的API显示Apple Watch的可用性.我还不想写一个Apple Watch App.在花时间开发手表版本(当然,如果可能的话)之前,我想做一些分析,看看实际用户有多少百分比的Apple Watch.
所以在WatchOS 2上这是可能的!
你必须在iPhone方面做:
第一:
import WatchConnectivity
Run Code Online (Sandbox Code Playgroud)
然后 :
if WCSession.isSupported() { // check if the device support to handle an Apple Watch
let session = WCSession.defaultSession()
session.delegate = self
session.activateSession() // activate the session
if session.paired { // Check if the iPhone is paired with the Apple Watch
// Do stuff
}
}
Run Code Online (Sandbox Code Playgroud)
我希望它会帮助你:)
| 归档时间: |
|
| 查看次数: |
1274 次 |
| 最近记录: |