Will this work for sending a function call with data from iPhone to Electron, and Electron sends back integer?
APPLE SIDE:
NSURLSessionDataTask *task = [myPhoton callFunction:@“digitalWrite” withArguments:@[@">>>>>> MY STRING OF UP TO 63 BYTES HERE <<<<<<<",@1] completion:^(NSNumber *resultCode, NSError *error) {
if (!error)
{
resultCode = >>>>>> 32 bit integer returned from Electron function <<<<<<<<<<
}
}];
int64_t bytesToReceive = task.countOfBytesExpectedToReceive;
// …do something with bytesToReceive <<<<<<<<<<<<< I DON’T UNDERSTAND THIS.
ELECTRON SIDE:
int my_function(String my_input_data_from_iPhone)
{
unsigned my_32bit_ output_data;
// process my_input_data_from_iPhone, and generate my_32bit_ output_data
…
return my_32bit_ output_data;
}