I'm currently working on making one app compatible with AppleWatch,
For that I'm calling one WebService, the problem is I'm getting WebService response in Block, and reply() block is not getting called there showing error.
Error,
The UIApplicationDelegate in the iPhone App never called reply() in -[UIApplicationDelegate application:handleWatchKitExtensionRequest:reply:]
My Appdelegate,
func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: (([NSObject : AnyObject]!) -> Void)!) {
getInfo(userInfo, reply: reply)
}
func getInfo(userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) ->Void)!){
let dicParam:NSDictionary = [:]
let wsfr:WSFrameWork = WSFrameWork(URLAndParams:WS_GET_DATA, dicParams: dicParam as [NSObject : AnyObject])
wsfr.isLogging = false
wsfr.onError = { (error : NSError!) -> Void in
reply(nil)
}
wsfr.onSuccess = { (dicResponse : Dictionary!) -> Void in
if dicResponse["data"] != nil{
let returnData = ["Returned NSData":dicResponse]
reply(returnData)
}
}
}
WSFrameWork is our WebService framework.