This issue seems to only be happening to a user who had a refurbished 935, the app crashes immediately. I'm not sure what is causing the Illegal access, If anyone can lend a hand it would be very much appreciated.
Crash log caught from running a test version
---
Error: Illegal Access (Out of Bounds)
Details: 'Failed invoking <symbol>'
Time: 2021-01-29T17:03:29Z
Part-Number: 006-B2691-00
Firmware-Version: '21.00'
Language-Code: eng
ConnectIQ-Version: 3.2.1
Filename: CORREC~1
Appname: 'App Name'
Stack:
- pc: 0x30004c91
- pc: 0x301057ad
- pc: 0x10000623
File: '/Users/Yada/Yada/Yada/Background.mc'
Line: 49
Function: onTemporalEvent
Here is where I register for the temporal event.
class appName extends app.appbase {
init() {
regForTempEvent();
}
function regTempEvent(){
if (Toybox.System has :ServiceDelegate) {
canDoBG = true;
Background.registerForTemporalEvent(new Time.Duration(5*60));
}
}
}
Here is the background service delegate
(:background)
class BgServiceDelegate extends System.ServiceDelegate {
function initialize() {
System.ServiceDelegate.initialize();
}
// callback function
function onReceive(responseCode, data) {
if (data == null) {
data = {};
}
data["responseCode"] = responseCode;
Background.exit(data);
}
function makeRequest() {
if (Communications has :makeWebRequest) {
var userName = App.getApp().getProperty("userName");
if (username == null) {
username = "";
}
var url = Lang.format($1$", [username]);
var options = {
:method => Communications.HTTP_REQUEST_METHOD_GET,
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
Communications.makeWebRequest(
url,
{},
options,
method(:onReceive)
);
}
}
function onTemporalEvent() {
makeRequest();
}
}