@situm/cordova 3.5.34 → 3.6.0
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.
package/CHANGELOG_UNRELEASED.md
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
###
|
|
2
|
-
|
|
1
|
+
### Added
|
|
2
|
+
|
|
3
|
+
- Added ForegroundServiceNotificationOptions functions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@situm/cordova",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Situm Wayfinding for Capacitor and Cordova. Integrate plug&play indoor navigation experience with floorplans, POIs, routes and turn-by-turn directions in no time. With the power of Situm.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": "https://github.com/situmtech/cordova",
|
package/plugin.xml
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package es.situm.plugin;
|
|
2
2
|
|
|
3
|
+
import static es.situm.plugin.JsonUtils.toMap;
|
|
4
|
+
|
|
3
5
|
import android.content.Context;
|
|
4
6
|
import android.graphics.Bitmap;
|
|
5
7
|
import android.util.Base64;
|
|
@@ -23,6 +25,7 @@ import java.util.Map;
|
|
|
23
25
|
import java.util.Arrays;
|
|
24
26
|
|
|
25
27
|
import es.situm.sdk.directions.DirectionsRequest;
|
|
28
|
+
import es.situm.sdk.location.ForegroundServiceNotificationOptions;
|
|
26
29
|
import es.situm.sdk.location.LocationRequest;
|
|
27
30
|
import es.situm.sdk.location.LocationStatus;
|
|
28
31
|
import es.situm.sdk.location.OutdoorLocationOptions;
|
|
@@ -229,6 +232,8 @@ class SitumMapper {
|
|
|
229
232
|
public static final String LOCATIONS = "locations";
|
|
230
233
|
public static final String POLL_TIME = "pollTime";
|
|
231
234
|
|
|
235
|
+
public static final String FOREGROUND_SERVICE_NOTIFICATION_OPTIONS = "foregroundServiceNotificationOptions";
|
|
236
|
+
|
|
232
237
|
public static final DateFormat dateFormat = DateUtils.dateFormat;
|
|
233
238
|
|
|
234
239
|
private static final String TAG = "PluginHelper";
|
|
@@ -759,6 +764,12 @@ static JSONObject buildingInfoToJsonObject(BuildingInfo buildingInfo) throws JSO
|
|
|
759
764
|
}
|
|
760
765
|
|
|
761
766
|
JSONObject request = args.getJSONObject(0);
|
|
767
|
+
if (request.has(SitumMapper.FOREGROUND_SERVICE_NOTIFICATION_OPTIONS)) {
|
|
768
|
+
JSONObject notificationOptions = request.getJSONObject(SitumMapper.FOREGROUND_SERVICE_NOTIFICATION_OPTIONS);
|
|
769
|
+
ForegroundServiceNotificationOptions notificationConfig = ForegroundServiceNotificationOptions.fromMap(toMap(notificationOptions));
|
|
770
|
+
locationBuilder.foregroundServiceNotificationOptions(notificationConfig);
|
|
771
|
+
}
|
|
772
|
+
|
|
762
773
|
if (request.has(SitumMapper.BUILDING_IDENTIFIER)) {
|
|
763
774
|
String buildingIdentifier = String.valueOf(request.get(SitumMapper.BUILDING_IDENTIFIER));
|
|
764
775
|
if (buildingIdentifier.isEmpty()) {
|
package/www/Interfaces.js
CHANGED
|
@@ -568,6 +568,7 @@ module.exports = SitumConversionArea;
|
|
|
568
568
|
* @property {number} smallestDisplacement - Default smallest displacement to nofiy location updates
|
|
569
569
|
* @property {string} realtimeUpdateInterval - Default interval to send locations to the Realtime. Possible values are REALTIME, FAST, NORMAL, SLOW and BATTERY_SAVER
|
|
570
570
|
* @property {boolean} autoEnableBleDuringPositioning - Set if the BLE should be re-enabled during positioning if the ble is used. Android only
|
|
571
|
+
* @property {ForegroundServiceNotificationOptions} foregroundServiceNotificationOptions - Used to configure the notification options for a foreground service, allowing the definition of the title, message, stop button, button text, and the {@link ForegroundServiceNotificationsTapAction}.
|
|
571
572
|
*/
|
|
572
573
|
var LocationRequest = {
|
|
573
574
|
buildingIdentifier,
|
|
@@ -584,11 +585,41 @@ var LocationRequest = {
|
|
|
584
585
|
beaconFilters,
|
|
585
586
|
smallestDisplacement,
|
|
586
587
|
realtimeUpdateInterval,
|
|
587
|
-
autoEnableBleDuringPositioning
|
|
588
|
+
autoEnableBleDuringPositioning,
|
|
589
|
+
foregroundServiceNotificationOptions
|
|
588
590
|
};
|
|
589
591
|
|
|
590
592
|
module.exports = LocationRequest;
|
|
591
593
|
|
|
594
|
+
/**
|
|
595
|
+
* @name ForegroundServiceNotificationOptions
|
|
596
|
+
*
|
|
597
|
+
* @description
|
|
598
|
+
* (Only applies for Android)
|
|
599
|
+
*
|
|
600
|
+
* A data object that let you customize the Foreground Service Notification
|
|
601
|
+
* that will be shown in the system's tray when the app is running as a
|
|
602
|
+
* Foreground Service. These options are defined within the {@link LocationRequest}.
|
|
603
|
+
*
|
|
604
|
+
* You can use the following tapAction behaviour:
|
|
605
|
+
* - 'LAUNCH_APP': Launch the app's main activity. This is the default value.
|
|
606
|
+
* - 'LAUNCH_SETTINGS': Launch the operating system settings screen for the app.
|
|
607
|
+
* - 'DO_NOTHING': Do nothing when tapping the notification.
|
|
608
|
+
* @property {string} title
|
|
609
|
+
* @property {string} message
|
|
610
|
+
* @property {boolean} showStopAction Whether to show or not the button that stops the positioning system. Defaults to true.
|
|
611
|
+
* @property {string} stopActionText
|
|
612
|
+
* @property {'DO_NOTHING' | 'LAUNCH_APP' | 'LAUNCH_SETTINGS'} tapAction Predefined actions performed when tapping the Situm Foreground Service Notification. Defaults to 'LAUNCH_APP'.
|
|
613
|
+
*/
|
|
614
|
+
var ForegroundServiceNotificationOptions = {
|
|
615
|
+
title,
|
|
616
|
+
message,
|
|
617
|
+
showStopAction,
|
|
618
|
+
stopActionText,
|
|
619
|
+
tapAction
|
|
620
|
+
};
|
|
621
|
+
module.exports = ForegroundServiceNotificationOptions;
|
|
622
|
+
|
|
592
623
|
/**
|
|
593
624
|
* @name
|
|
594
625
|
* LocationOptions
|
|
@@ -650,14 +681,13 @@ var DirectionsRequest = {
|
|
|
650
681
|
|
|
651
682
|
module.exports = DirectionsRequest;
|
|
652
683
|
|
|
653
|
-
|
|
654
684
|
/**
|
|
655
685
|
* @name
|
|
656
686
|
* ExternalNavigation
|
|
657
687
|
* @description
|
|
658
688
|
* For internal use only.
|
|
659
689
|
* @property {String} messageType
|
|
660
|
-
* @property {Map} payload
|
|
690
|
+
* @property {Map} payload
|
|
661
691
|
*/
|
|
662
692
|
var ExternalNavigation = {
|
|
663
693
|
messageType,
|