jjzjj

replyHandler

全部标签

ios - Watchkit 新 session 不起作用

我的watch扩展中有两个ViewController。每当我调用[[WCSessiondefaultSession]sendMessage:applicationDatareplyHandler:^(NSDictionary*reply){}我只得到第一个ViewController的响应,第二个ViewController出现错误ErrorDomain=WCErrorDomainCode=7011"Messagereplyfailed."UserInfo={NSUnderlyingError=0x79f1f100{ErrorDomain=WCErrorDomainCode=7010

ios - 观看连接 : didReceiveMessage not called

我正在使用WatchConnectivity框架从我的应用程序接收字符串。以下是我如何从应用程序发送Obj-C中的字符串:-(void)viewDidLoad{//WATCHKITWCSession*session=[WCSessiondefaultSession];session.delegate=self;[sessionactivateSession];[selfsendInfoToWatch];}-(void)sendInfoToWatch{WCSession*session=[WCSessiondefaultSession];session.delegate=self;[se

ios - WCSession 发送消息 :replyHandler error code 7014 (WCErrorCodeDeliveryFailed)

我有一个WatchOS2应用程序,它通过WCSession方法与iOS应用程序通信sendMessage:replyHandler:errorHandler:iOS应用程序回复正确,但有时我收到域WCErrorDomain的代码7014的错误:“无法传递有效负载”当iOS应用程序不在前台时,这种情况更常发生。我没有找到这个问题的任何解决方案,我希望你们中的一个知道这个问题的解决方案 最佳答案 在我的例子中,我必须实现两个委托(delegate):没有任何replyHandlerfuncsession(_session:WCSessi