I searched the forum, and read all the old threads related to onBackgroundData, but I can't find out why it's not working.
(:background) class MyServiceDelegate extends System.ServiceDelegate { function initialize() { Background.exit("this works"); } function onTemporalEvent() as Void { log("onTemporalEvent"); // Background.exit("test1"); doTheWork(); // Background.exit("test2"); } }
My problem is that onBackgroundData is not being called after I call Background.exit(non null String or Number); The only place where it works is when I call it from the constructor of the ServiceDelegate, which of course makes no sense, because then the job didn't even start yet, but at least it proves that the onBackgroundData in the foreground app is OK.
When I call Background.exit("str") from anywhere else (my real place is the onReceive callback of makeWebRequest, but even if I call it from the beginning of onTemporalEvent) onBackgroundData is not called. What can be the culprit?
SDK 4.1.7, simulator, fr255, datafield