Skip to content

Commit

Permalink
Adding Dummy Callback - null
Browse files Browse the repository at this point in the history
  • Loading branch information
britiger committed Oct 24, 2020
1 parent 77c9206 commit 6f5f3f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions CriticalMapsAPIBarrel.mc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ module CriticalMapsAPIBarrel {
// set response type
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
if(callbackMethod == null) {
callbackMethod = new Lang.Method(CriticalMapsAPIBarrel, :onReceive);
}
Communications.makeWebRequest(url, parms, options, callbackMethod);
return 0;
}
Expand All @@ -130,6 +133,16 @@ module CriticalMapsAPIBarrel {
return {"responseCode" => responseCode, "nearestCM" => nearestCM, "countCM10" => countCM10, "chatText" => chatText, "mapMarkers" => mapMarkers};
}

// dummy-callback function
function onReceive(responseCode, data) {
if (responseCode == 200) {
System.println("Request Successful"); // print success
}
else {
System.println("Response: " + responseCode); // print response code
}
}

function parseData(data) {
var locations = data["locations"];
var devices = locations.keys();
Expand Down
2 changes: 1 addition & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. --><iq:manifest xmlns:iq="http://www.garmin.com/xml/connectiq" version="3">
<iq:barrel id="3f84178eba974605b31604eacfcf94e4" minSdkVersion="2.4.0" module="CriticalMapsAPIBarrel" version="0.3.0">
<iq:barrel id="3f84178eba974605b31604eacfcf94e4" minSdkVersion="2.4.0" module="CriticalMapsAPIBarrel" version="0.3.1">
<iq:products>
<iq:product id="edge1030"/>
<iq:product id="edge1030bontrager"/>
Expand Down

0 comments on commit 6f5f3f5

Please sign in to comment.