내가 그 방법을 구현 한 후 WCSession
방법 sendMessage:replyHandler:errorHandler:
는 WCErrorCodeDeliveryFailed :</p> <p>WCSession _onqueue_notifyOfMessageError : 페이로드가
를 사용하여 아이폰과 애플 시계 사이에 데이터를 공유, 나는 같은 오류가 응용 프로그램에서 일하고 있어요 배달 할 수없는 : withErrorHandler : errorHandler : 예 (WCErrorCodeDeliveryFailed)입니다.
Error = 페이로드를 전달할 수 없습니다.
import Foundation
import WatchKit
import WatchConnectivity
class ResultInterfaceController: WKInterfaceController, WCSessionDelegate {
override func awake(withContext context: Any?) {
super.awake(withContext: context)
let applicationData = ["name": "ViratKohli"]
self.sendToPhone(data: applicationData)
}
func sendToPhone(data: [String: Any]) {
if WCSession.isSupported() {
let session = WCSession.default
session().delegate = self
session().activate()
if WCSession.default().isReachable {
session().sendMessage(data, replyHandler: {(_ replyMessage: [String: Any]) -> Void in
print("ReplyHandler called = \(replyMessage)")
WKInterfaceDevice.current().play(WKHapticType.notification)
},
errorHandler: {(_ error: Error) -> Void in
print("Error = \(error.localizedDescription)")
})
}
}
}
....
도움을 주시면 감사하겠습니다.
[this] (http://stackoverflow.com/questions/33200630/wcsession-sendmessagereplyhandler-error-code-7014-wrocrorcodedeliveryfailed) 도움이 될까요? –
@ ReinhardMänner nope. 그게 아니라 – SahyadriChava