@situm/cordova 3.17.5 → 3.17.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ dependencies {
44
44
  implementation ('com.googlecode.json-simple:json-simple:1.1.1'){
45
45
  exclude group: 'junit', module:'junit'
46
46
  }
47
- implementation ('es.situm:situm-sdk:3.38.0@aar') {
47
+ implementation ('es.situm:situm-sdk:3.39.0@aar') {
48
48
  transitive = true
49
49
  }
50
50
  implementation 'org.apache.cordova:framework:11.0.0'
@@ -192,8 +192,10 @@ public class PluginHelper {
192
192
  try {
193
193
  JSONObject jsonoBuilding = args.getJSONObject(0);
194
194
  Building building = SitumMapper.buildingJsonObjectToBuilding(jsonoBuilding);
195
-
196
- getCommunicationManagerInstance().fetchBuildingInfo(building, new Handler<BuildingInfo>() {
195
+ if (building == null) {
196
+ callbackContext.sendPluginResult(new PluginResult(Status.ERROR, "Error fetching Building Info: failed mapping Building object from Json."));
197
+ }
198
+ getCommunicationManagerInstance().fetchBuildingInfo(building.getIdentifier(), new Handler<BuildingInfo>() {
197
199
  @Override
198
200
  public void onSuccess(BuildingInfo object) {
199
201
  try {
@@ -267,7 +269,10 @@ public class PluginHelper {
267
269
  try {
268
270
  JSONObject jsonoBuilding = args.getJSONObject(0);
269
271
  Building building = SitumMapper.buildingJsonObjectToBuilding(jsonoBuilding);
270
- getCommunicationManagerInstance().fetchFloorsFromBuilding(building, new Handler<Collection<Floor>>() {
272
+ if (building == null) {
273
+ callbackContext.sendPluginResult(new PluginResult(Status.ERROR, "Error fetching Floors from Building: failed mapping Building object from Json."));
274
+ }
275
+ getCommunicationManagerInstance().fetchFloorsFromBuilding(building.getIdentifier(), new Handler<Collection<Floor>>() {
271
276
  @Override
272
277
  public void onSuccess(Collection<Floor> floors) {
273
278
  try {
@@ -307,7 +312,10 @@ public class PluginHelper {
307
312
  try {
308
313
  JSONObject jsonoBuilding = args.getJSONObject(0);
309
314
  Building building = SitumMapper.buildingJsonObjectToBuilding(jsonoBuilding);
310
- getCommunicationManagerInstance().fetchIndoorPOIsFromBuilding(building, new HashMap<String, Object>(),
315
+ if (building == null) {
316
+ callbackContext.sendPluginResult(new PluginResult(Status.ERROR, "Error fetching Indoor POIs from Building: failed mapping Building object from Json."));
317
+ }
318
+ getCommunicationManagerInstance().fetchIndoorPOIsFromBuilding(building.getIdentifier(),
311
319
  new Handler<Collection<Poi>>() {
312
320
  @Override
313
321
  public void onSuccess(Collection<Poi> pois) {
@@ -350,7 +358,10 @@ public class PluginHelper {
350
358
  try {
351
359
  JSONObject jsonoBuilding = args.getJSONObject(0);
352
360
  Building building = SitumMapper.buildingJsonObjectToBuilding(jsonoBuilding);
353
- getCommunicationManagerInstance().fetchOutdoorPOIsFromBuilding(building, new HashMap<String, Object>(),
361
+ if (building == null) {
362
+ callbackContext.sendPluginResult(new PluginResult(Status.ERROR, "Error fetching fetching Outdoor POIs from Building: failed mapping Building object from Json."));
363
+ }
364
+ getCommunicationManagerInstance().fetchOutdoorPOIsFromBuilding(building.getIdentifier(),
354
365
  new Handler<Collection<Poi>>() {
355
366
  @Override
356
367
  public void onSuccess(Collection<Poi> pois) {
@@ -421,7 +432,7 @@ public class PluginHelper {
421
432
  try {
422
433
  JSONObject jsonoCategory = args.getJSONObject(0);
423
434
  PoiCategory category = SitumMapper.poiCategoryFromJsonObject(jsonoCategory);
424
- getCommunicationManagerInstance().fetchPoiCategoryIconNormal(category, new Handler<Bitmap>() {
435
+ getCommunicationManagerInstance().fetchPoiCategoryIcon(category, false, new Handler<Bitmap>() {
425
436
  @Override
426
437
  public void onSuccess(Bitmap bitmap) {
427
438
  try {
@@ -450,7 +461,7 @@ public class PluginHelper {
450
461
  try {
451
462
  JSONObject jsonoCategory = args.getJSONObject(0);
452
463
  PoiCategory category = SitumMapper.poiCategoryFromJsonObject(jsonoCategory);
453
- getCommunicationManagerInstance().fetchPoiCategoryIconSelected(category, new Handler<Bitmap>() {
464
+ getCommunicationManagerInstance().fetchPoiCategoryIcon(category, true, new Handler<Bitmap>() {
454
465
  @Override
455
466
  public void onSuccess(Bitmap bitmap) {
456
467
  try {
@@ -479,7 +490,10 @@ public class PluginHelper {
479
490
  try {
480
491
  JSONObject jsonoBuilding = args.getJSONObject(0);
481
492
  Building building = SitumMapper.buildingJsonObjectToBuilding(jsonoBuilding);
482
- getCommunicationManagerInstance().fetchEventsFromBuilding(building, new HashMap<String, Object>(),
493
+ if (building == null) {
494
+ callbackContext.sendPluginResult(new PluginResult(Status.ERROR, "Error fetching Events from Building: failed mapping Building object from Json."));
495
+ }
496
+ getCommunicationManagerInstance().fetchEventsFromBuilding(building.getIdentifier(),
483
497
  new Handler<Collection<es.situm.sdk.v1.SitumEvent>>() {
484
498
  @Override
485
499
  public void onSuccess(Collection<SitumEvent> situmEvents) {
@@ -63,9 +63,6 @@ import es.situm.sdk.userhelper.UserHelperColorScheme;
63
63
 
64
64
  class SitumMapper {
65
65
 
66
- public static final float MIN_SNR = 10;
67
- public static final float MAX_SNR = 40;
68
-
69
66
  public static final String ADDRESS = "address";
70
67
  public static final String BOUNDS = "bounds";
71
68
  public static final String BOUNDS_ROTATED = "boundsRotated";
@@ -188,9 +185,7 @@ class SitumMapper {
188
185
  public static final String AUTO_ENABLE_BLE = "autoEnableBleDuringPositioning";
189
186
 
190
187
  public static final String OUTDOOR_LOCATION_OPTIONS = "outdoorLocationOptions";
191
- public static final String USER_DEFINED_THRESHOLD = "userDefinedThreshold";
192
188
  public static final String COMPUTE_INTERVAL = "computeInterval";
193
- public static final String AVERAGE_SNR_THRESHOLD = "averageSnrThreshold";
194
189
 
195
190
  public static final String BEACON_FILTERS = "beaconFilters";
196
191
  public static final String UUID = "uuid";
@@ -911,12 +906,6 @@ static JSONObject buildingInfoToJsonObject(BuildingInfo buildingInfo) throws JSO
911
906
  static OutdoorLocationOptions buildOutdoorLocationOptions(JSONObject outdoorLocationOptions) throws JSONException{
912
907
  OutdoorLocationOptions.Builder optionsBuilder = new OutdoorLocationOptions.Builder();
913
908
 
914
- if (outdoorLocationOptions.has(SitumMapper.USER_DEFINED_THRESHOLD)) {
915
- Boolean userDefinedThreshold = outdoorLocationOptions.getBoolean(SitumMapper.USER_DEFINED_THRESHOLD);
916
- optionsBuilder.userDefinedThreshold(userDefinedThreshold);
917
- Log.i(TAG, "userDefinedThreshold: " + userDefinedThreshold);
918
- }
919
-
920
909
  if (outdoorLocationOptions.has(SitumMapper.COMPUTE_INTERVAL)) {
921
910
  Integer computeInterval = outdoorLocationOptions.getInt(SitumMapper.COMPUTE_INTERVAL);
922
911
  if (computeInterval != null && computeInterval >= 1) {
@@ -924,13 +913,6 @@ static JSONObject buildingInfoToJsonObject(BuildingInfo buildingInfo) throws JSO
924
913
  Log.i(TAG, "computeInterval: " + computeInterval);
925
914
  }
926
915
  }
927
-
928
- if (outdoorLocationOptions.has(SitumMapper.AVERAGE_SNR_THRESHOLD));
929
- Float averageSnrThreshold = new Float(outdoorLocationOptions.getDouble(SitumMapper.AVERAGE_SNR_THRESHOLD));
930
- if (averageSnrThreshold != null && averageSnrThreshold >= MIN_SNR && averageSnrThreshold <= MAX_SNR) {
931
- optionsBuilder.averageSnrThreshold(averageSnrThreshold);
932
- Log.i(TAG, "averageSnrThreshold: " + averageSnrThreshold);
933
- }
934
916
  return optionsBuilder.build();
935
917
  }
936
918
 
@@ -11,7 +11,7 @@ allprojects {
11
11
  }
12
12
 
13
13
  dependencies {
14
- implementation('es.situm:situm-sdk:3.38.0@aar') {
14
+ implementation('es.situm:situm-sdk:3.39.0@aar') {
15
15
  transitive = true
16
16
  }
17
17
  }
package/www/Interfaces.js CHANGED
@@ -725,15 +725,11 @@ module.exports = DirectionsOptions;
725
725
  * OutdoorLocationOptions
726
726
  * @description
727
727
  * Outdoor location options are only used in indoor-outdoor mode (Only available for Android)
728
- * @property {boolean} userDefinedThreshold
729
728
  * @property {number} computeInterval - Interval (in milliseconds) between consecutive GPS readings performed by Situm SDK, and therefore between consecutive generated Outdoor Locations.
730
- * @property {number} averageSnrThreshold
731
729
  */
732
730
 
733
731
  var OutdoorLocationOptions = {
734
- userDefinedThreshold,
735
732
  computeInterval,
736
- averageSnrThreshold
737
733
  };
738
734
 
739
735
  module.exports = OutdoorLocationOptions;