Skip to content

Commit 6f5f3f5

Browse files
committed
Adding Dummy Callback - null
1 parent 77c9206 commit 6f5f3f5

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CriticalMapsAPIBarrel.mc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ module CriticalMapsAPIBarrel {
112112
// set response type
113113
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
114114
};
115+
if(callbackMethod == null) {
116+
callbackMethod = new Lang.Method(CriticalMapsAPIBarrel, :onReceive);
117+
}
115118
Communications.makeWebRequest(url, parms, options, callbackMethod);
116119
return 0;
117120
}
@@ -130,6 +133,16 @@ module CriticalMapsAPIBarrel {
130133
return {"responseCode" => responseCode, "nearestCM" => nearestCM, "countCM10" => countCM10, "chatText" => chatText, "mapMarkers" => mapMarkers};
131134
}
132135

136+
// dummy-callback function
137+
function onReceive(responseCode, data) {
138+
if (responseCode == 200) {
139+
System.println("Request Successful"); // print success
140+
}
141+
else {
142+
System.println("Response: " + responseCode); // print response code
143+
}
144+
}
145+
133146
function parseData(data) {
134147
var locations = data["locations"];
135148
var devices = locations.keys();

manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- 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">
2-
<iq:barrel id="3f84178eba974605b31604eacfcf94e4" minSdkVersion="2.4.0" module="CriticalMapsAPIBarrel" version="0.3.0">
2+
<iq:barrel id="3f84178eba974605b31604eacfcf94e4" minSdkVersion="2.4.0" module="CriticalMapsAPIBarrel" version="0.3.1">
33
<iq:products>
44
<iq:product id="edge1030"/>
55
<iq:product id="edge1030bontrager"/>

0 commit comments

Comments
 (0)