मैं एप्लिकेशन iPhone और एप्पल घड़ी के बीच कि शेयर डेटा, WCSession
विधि sendMessage:replyHandler:errorHandler:
WCErrorCodeDeliveryFailed: पेलोड वितरित नहीं किया जा सकता है
का उपयोग कर उस विधि को लागू करने के बाद मैं जैसे त्रुटि मिलती है पर काम कर रहा हूँ:
WCSession _onqueue_notifyOfMessageError : withErrorHandler: errorHandler: WCErrorCodeDeliveryFailed के साथ हाँ।
त्रुटि = पेलोड वितरित नहीं किया जा सका।
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)")
})
}
}
}
....
किसी भी मदद की सराहना की।
शायद [यह] (http://stackoverflow.com/questions/33200630/wcsession-sendmessagereplyhandler-error-code-7014-wcerrorcodedeliveryfailed) आपकी मदद करता है? –
@ रेनहार्ड मैनर नॉप। यह – SahyadriChava