Hello,
I just can't find the issue with this code, it's mostly identical to the examples in the documentation. I get the following error:
Error: Invalid Value
Details: Failed invoking <symbol>
Code:
Hello,
I just can't find the issue with this code, it's mostly identical to the examples in the documentation. I get the following error:
Error: Invalid Value
Details: Failed invoking <symbol>
Code:
do you have correct permisions
<iq:uses-permission id="Background"/>
<iq:uses-permission id="Communications"/>
Why don't you simple put method directly in call:
Communications.makeWebRequest(url, params, options, :onReceive);
Permissions are there, so it's not about those.
You could try self.method(:onReceive) inside the class.
I tried even that
is your onReceive function in the same class as you are trying to do the method(:onReceive)?
yes, you can see in the code above. Both are in LogService class.
how do you invoke makeRequest()?
maybe bug is in line Time.now()
- no import Time
- I'm wonder what is put in params.dateTime as now() returns Moment....
it's nothing about that, the error is on line:
var callback = method(:onReceive); // Here I get the error
I made it work by removing the 2 methods from the class (having them global) and using:
I think you hit the memory limit for background process. I got a similar error on a glance view while using a big API class. Reducing the amount of uses classes (perhaps vopy only needednfunctions into a separated background class could solve this issue.
The error is not really useful if it's caused by a memory limit.
PS: Perhaps all would be fine until calling the makeWebRequest. The result (http body) and the converted JSON object will need additional memory. That could cause a app crash due to the memory limit. Then you will get a similar error message.
Were you using the class or an instance of the class?
so
LogService.makeRequest();
or
var x=new LogService();
x.makeRequest();