Skip to content

Commit

Permalink
Merge pull request #77 from situmtech/release/0.3.0
Browse files Browse the repository at this point in the history
Release/0.3.0
  • Loading branch information
fsvilas committed Mar 14, 2022
2 parents 91c245d + 8614193 commit 0e54f22
Show file tree
Hide file tree
Showing 21 changed files with 667 additions and 82 deletions.
25 changes: 25 additions & 0 deletions .bartycrouch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[update]
tasks = ["code", "normalize"]

[update.code]
codePaths = ["SitumWayfinding/"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs"]
localizablePaths = ["SitumWayfinding/"]
defaultToKeys = false
additive = true
unstripped = false
plistArguments = true
ignoreKeys = ["#bartycrouch-ignore!", "#bc-ignore!", "#i!"]

[update.normalize]
paths = ["SitumWayfinding/"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs"]
sourceLocale = "en"
harmonizeWithSource = true
sortByKeys = true

[lint]
paths = ["SitumWayfinding/"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs"]
duplicateKeys = true
emptyValues = true
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
All non released changes should be in CHANGELOG_UNRELEASED.md file

---------
## [0.3.0] - 2022-03-14

### Added:
* The setShowTextPois method has been added in SitumMapsLibrary. This method allows that the name of each POIs is shown on the map above the POI icon. If it is set to true, the POI name is seen above the POI icon, if it is set to false, only the POI icon appears.
* Added localization for spanish language in Wayfinding

## [0.2.0] - 2022-02-21
### Added
* Added protocol OnNavigationListener and a method setOnNavigationListener on SitumMapsLibrary. As a developer you can
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@


37 changes: 37 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SitumWayfinding develompent

## Enable localizations in apps
In order to see the localizations of the module WayFinding in the app, you must configure localization for the languages
that you need to support. To do that in your app go to Project (click on root folder in project navigator)
-> Info -> Localizations, and click in the `+` icon to add the language you want to support.

## Localization treatment
A bundle is used to store string localization files of SitumWayfinding library. Because of this when you translate a
string in the library you must make reference to library bundle.
Use `NSLocalizedString("key", bundle: SitumMapsLibrary.bundle, comment: "")` to reference library bundle.

To make localization easy [BartyCrouch](https://github.com/Flinesoft/BartyCrouch) is used. You need to install it first
before use https://github.com/Flinesoft/BartyCrouch#installation. There is a file `.bartycrouch.toml` in the root
directory of the project with configuration for this library. It is configured to only localize files under
`SitumWayfinding/` folder. (If we need to change this in the future the documentation about this file is in
https://github.com/Flinesoft/BartyCrouch#configuration)

Cheatsheet:
```bash
bartycrouch update # search for all NSLocalizedString in project and update Localizable.strings accordingly
bartycrouch lint # check the content of Localizable.strings for empty values and duplicates
```

A useful script to set in `.git/hooks/pre-commit` is the following:
```bash
#!/bin/sh
/usr/local/bin/bartycrouch update
/usr/local/bin/bartycrouch lint -w # -w fails on warning to avoid commit
```

## Documentation
The documentation is made with [jazzy](https://github.com/realm/jazzy). In order to build documentation execute
the following from the root of the project:
```bash
./scripts/generate_appledoc.sh
```
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PODS:
- SitumSDK (2.52.0):
- Protobuf (~> 3.7)
- SSZipArchive (~> 2.4)
- SitumWayfinding (0.2.0):
- SitumWayfinding (0.3.0):
- GoogleMaps (~> 4.2.0)
- SitumSDK (~> 2.52.0)
- SSZipArchive (2.4.3)
Expand All @@ -31,7 +31,7 @@ SPEC CHECKSUMS:
GoogleMaps: eb03e327edfd70b06de1e6e321653f73712df7ad
Protobuf: 235750e4696ff59fb07d949a9dbbc92b3c0700fe
SitumSDK: cc0a5b48a90669c463622b12ae6f07588863f5af
SitumWayfinding: 5a7a574f799580866b751b57522a224b04fa8ec6
SitumWayfinding: c759a99469f88361d5881700d3a5aa5370d2438a
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef

PODFILE CHECKSUM: 181eb894514efe3e0119ec84dae5349934aaaa20
Expand Down
5 changes: 5 additions & 0 deletions Example/SitumWayfinding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
87DA24DF57187B9EDCD8A06B /* Pods-SitumWayfinding_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumWayfinding_Example.debug.xcconfig"; path = "Target Support Files/Pods-SitumWayfinding_Example/Pods-SitumWayfinding_Example.debug.xcconfig"; sourceTree = "<group>"; };
8B54116471FA3975AF6EC8F1 /* Pods_SitumWayfinding_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SitumWayfinding_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9ED9CFBA6AF02E01E1C341BF /* Pods-SitumWayfinding_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SitumWayfinding_Example.release.xcconfig"; path = "Target Support Files/Pods-SitumWayfinding_Example/Pods-SitumWayfinding_Example.release.xcconfig"; sourceTree = "<group>"; };
D7EC26F127DA18A200ABD5A7 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Main.strings; sourceTree = "<group>"; };
DEA375CE0ED3393820EC8160 /* SitumWayfinding.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SitumWayfinding.podspec; path = ../SitumWayfinding.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -249,6 +250,7 @@
English,
en,
Base,
es,
);
mainGroup = 607FACC71AFB9204008FA782;
productRefGroup = 607FACD11AFB9204008FA782 /* Products */;
Expand Down Expand Up @@ -353,6 +355,7 @@
"${PODS_ROOT}/../../SitumWayfinding/Assets/Images/logo/swf_logo@2x.png",
"${PODS_ROOT}/../../SitumWayfinding/Assets/Images/logo/swf_logo@3x.png",
"${PODS_ROOT}/../../SitumWayfinding/Assets/Images/radius/swf_radius.png",
"${PODS_CONFIGURATION_BUILD_DIR}/SitumWayfinding/SitumWayfinding.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand All @@ -379,6 +382,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/swf_logo@2x.png",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/swf_logo@3x.png",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/swf_radius.png",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SitumWayfinding.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -421,6 +425,7 @@
isa = PBXVariantGroup;
children = (
607FACDA1AFB9204008FA782 /* Base */,
D7EC26F127DA18A200ABD5A7 /* es */,
);
name = Main.storyboard;
sourceTree = "<group>";
Expand Down
21 changes: 21 additions & 0 deletions Example/SitumWayfinding/es.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

/* Class = "UILabel"; text = "Use remote configuratioon"; ObjectID = "8Dl-6u-dKQ"; */
"8Dl-6u-dKQ.text" = "Use remote configuratioon";

/* Class = "UILabel"; text = "Wayfinding Example"; ObjectID = "LYZ-5T-B5U"; */
"LYZ-5T-B5U.text" = "Wayfinding Example";

/* Class = "UILabel"; text = "List of available POIs"; ObjectID = "TUz-42-YwY"; */
"TUz-42-YwY.text" = "List of available POIs";

/* Class = "UIButton"; normalTitle = "Load Wayfinding and navigate to coordinate"; ObjectID = "Z1c-hI-Wjv"; */
"Z1c-hI-Wjv.normalTitle" = "Load Wayfinding and navigate to coordinate";

/* Class = "UIButton"; normalTitle = "Load Wayfinding and navigate to POI"; ObjectID = "ey9-zA-wx2"; */
"ey9-zA-wx2.normalTitle" = "Load Wayfinding and navigate to POI";

/* Class = "UIButton"; normalTitle = "Load Wayfinding"; ObjectID = "kYz-PR-o25"; */
"kYz-PR-o25.normalTitle" = "Load Wayfinding";

/* Class = "UIButton"; normalTitle = "Load Wayfinding and select POI"; ObjectID = "xXD-lc-Tl4"; */
"xXD-lc-Tl4.normalTitle" = "Load Wayfinding and select POI";
12 changes: 10 additions & 2 deletions SitumWayfinding.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'SitumWayfinding'
s.version = '0.2.0'
s.version = '0.3.0'
s.summary = 'Indoor Location for iOS.'
s.static_framework = true

Expand All @@ -26,7 +26,15 @@ Pod::Spec.new do |s|
s.swift_version = '5.0'

s.source_files = 'SitumWayfinding/Classes/**/*'
s.resources = ['SitumWayfinding/Assets/*.storyboard', 'SitumWayfinding/Assets/Images/**/*.png']
s.resources = [
'SitumWayfinding/Assets/*.storyboard',
'SitumWayfinding/Assets/Images/**/*.png',
]
s.resource_bundles = {
'SitumWayfinding' => [
'SitumWayfinding/Localizations/**/*',
]
}
s.dependency 'GoogleMaps', '~> 4.2.0'
s.dependency 'SitumSDK', '~> 2.52.0'

Expand Down
1 change: 1 addition & 0 deletions SitumWayfinding/Assets/SitumWayfinding.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
</constraints>
</view>
<connections>
<outlet property="backButton" destination="ysb-eJ-ja8" id="Tse-P7-KFK"/>
<outlet property="cancelNavigationButton" destination="0tN-NH-EBq" id="SkR-PT-9nf"/>
<outlet property="centerButton" destination="x1X-sn-fxl" id="mzE-8y-1mR"/>
<outlet property="currentIndicationLabel" destination="IVC-BM-fvT" id="8Sh-au-DXE"/>
Expand Down
28 changes: 21 additions & 7 deletions SitumWayfinding/Classes/Positioning/PositioningPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class PositioningPresenter: NSObject, SITLocationDelegate, SITDirectionsDelegate
var locationManager: SITLocationManager = SITLocationManager.sharedInstance()

var useRemoteConfig: Bool = false

let compassCalibrationAlertTitle = "Compass calibration needed"
let oobAlertTitle = "User outside building"
let outsideRouteAlertTitle = "User ouside route"

init(view: PositioningView, buildingInfo: SITBuildingInfo, interceptorsManager: InterceptorsManager) {
self.view = view
Expand Down Expand Up @@ -387,14 +383,26 @@ class PositioningPresenter: NSObject, SITLocationDelegate, SITDirectionsDelegate
break;
case .compassNeedsCalibration:
stateName = "Compass needs calibration"
showAlertIfNeeded(type: .compassCalibrationNeeded, title: self.compassCalibrationAlertTitle, message: "Your device's compass isn't calibrated right now. Please recalibrate it to obtain the best navigation experience.")
let compassCalibrationAlertTitle = NSLocalizedString("positioning.calibrationNeeded.alert.title",
bundle: SitumMapsLibrary.bundle,
comment: "The user needs to calibrate the compass")
showAlertIfNeeded(type: .compassCalibrationNeeded, title: compassCalibrationAlertTitle,
message: NSLocalizedString("positioning.calibrationNeeded.alert.message",
bundle: SitumMapsLibrary.bundle,
comment: ""))
break;
case .userNotInBuilding:
stateName = "User not in building"
if isUserNavigating(){
view?.stopNavigation(status: .error(NavigationError.outsideBuilding))
}
showAlertIfNeeded(type: .outOfBuilding, title: self.oobAlertTitle, message: "The user is currently outside of the building. Positioning will resume when the user returns.")
let oobAlertTitle = NSLocalizedString("positioning.outsideBuilding.alert.title",
bundle: SitumMapsLibrary.bundle,
comment: "Alert title to show user is outside of building")
showAlertIfNeeded(type: .outOfBuilding, title: oobAlertTitle,
message: NSLocalizedString("positioning.outsideBuilding.alert.message",
bundle: SitumMapsLibrary.bundle,
comment: "") )
break;
}
Logger.logDebugMessage("Location manager updates state: \(stateName)")
Expand Down Expand Up @@ -442,7 +450,13 @@ class PositioningPresenter: NSObject, SITLocationDelegate, SITDirectionsDelegate
Logger.logDebugMessage("user outside route detected: \(route.debugDescription)");

if isUserIndoor(){
showAlertIfNeeded(type: .outsideRoute, title: self.outsideRouteAlertTitle, message: "The user is not currently detected on the route. Please go back to resume navigation.")
let message = NSLocalizedString("positioning.outsideBuilding.alert.message",
bundle: SitumMapsLibrary.bundle,
comment: "Alert message to show user is outside of route")
let outsideRouteAlertTitle = NSLocalizedString("positioning.outsideRoute.alert.title",
bundle: SitumMapsLibrary.bundle,
comment: "Alert title to show user is outside of route")
showAlertIfNeeded(type: .outsideRoute, title: outsideRouteAlertTitle, message: message)
}else{
view?.stopNavigation(status: .error(NavigationError.outsideBuilding))
}
Expand Down

0 comments on commit 0e54f22

Please sign in to comment.