@situm/cordova 3.0.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.
Files changed (313) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/CHANGELOG_UNRELEASED.md +28 -0
  3. package/Jenkinsfile +84 -0
  4. package/LICENSE +21 -0
  5. package/README.md +472 -0
  6. package/azure/common-steps.yaml +5 -0
  7. package/azure-pipelines.yml +336 -0
  8. package/docs/JSDoc/MapView.html +300 -0
  9. package/docs/JSDoc/MapViewControllerImpl.html +299 -0
  10. package/docs/JSDoc/Situm.html +5257 -0
  11. package/docs/JSDoc/android_Interfaces.js.html +825 -0
  12. package/docs/JSDoc/android_situm.js.html +380 -0
  13. package/docs/JSDoc/fonts/glyphicons-halflings-regular.eot +0 -0
  14. package/docs/JSDoc/fonts/glyphicons-halflings-regular.svg +288 -0
  15. package/docs/JSDoc/fonts/glyphicons-halflings-regular.ttf +0 -0
  16. package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff +0 -0
  17. package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
  18. package/docs/JSDoc/global.html +7538 -0
  19. package/docs/JSDoc/img/toast-ui.png +0 -0
  20. package/docs/JSDoc/index.html +90 -0
  21. package/docs/JSDoc/map-view-controller.js.html +307 -0
  22. package/docs/JSDoc/map-view.js.html +172 -0
  23. package/docs/JSDoc/scripts/jquery.min.js +2 -0
  24. package/docs/JSDoc/scripts/linenumber.js +30 -0
  25. package/docs/JSDoc/scripts/prettify/Apache-License-2.0.txt +202 -0
  26. package/docs/JSDoc/scripts/prettify/lang-css.js +2 -0
  27. package/docs/JSDoc/scripts/prettify/prettify.js +28 -0
  28. package/docs/JSDoc/scripts/tui-doc.js +200 -0
  29. package/docs/JSDoc/styles/bootstrap.min.css +6 -0
  30. package/docs/JSDoc/styles/custom.css +23 -0
  31. package/docs/JSDoc/styles/prettify-jsdoc.css +111 -0
  32. package/docs/JSDoc/styles/prettify-tomorrow.css +132 -0
  33. package/docs/JSDoc/styles/tui-doc.css +485 -0
  34. package/docs/conf.json +28 -0
  35. package/docs/getting-started.md +298 -0
  36. package/docs/imagotype-SITUM-transparent-90.png +0 -0
  37. package/docs/static/styles/custom.css +23 -0
  38. package/package.json +60 -0
  39. package/plugin.xml +102 -0
  40. package/scripts/update_changelog.sh +22 -0
  41. package/src/android/app/build.gradle +51 -0
  42. package/src/android/app/proguard-rules.pro +21 -0
  43. package/src/android/app/src/main/AndroidManifest.xml +11 -0
  44. package/src/android/app/src/main/java/es/situm/plugin/DateUtils.java +15 -0
  45. package/src/android/app/src/main/java/es/situm/plugin/PluginHelper.java +919 -0
  46. package/src/android/app/src/main/java/es/situm/plugin/SitumMapper.java +968 -0
  47. package/src/android/app/src/main/java/es/situm/plugin/SitumPlugin.java +109 -0
  48. package/src/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  49. package/src/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  50. package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  51. package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  52. package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  53. package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  54. package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  55. package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  56. package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  57. package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  58. package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  59. package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  60. package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  61. package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  62. package/src/android/app/src/main/res/values/colors.xml +6 -0
  63. package/src/android/app/src/main/res/values/strings.xml +3 -0
  64. package/src/android/app/src/main/res/values/styles.xml +11 -0
  65. package/src/android/app/src/test/java/es/situm/plugin/PluginHelperTest.java +27 -0
  66. package/src/android/app/src/test/java/es/situm/plugin/SitumMapperTest.java +1485 -0
  67. package/src/android/app/src/test/java/es/situm/plugin/angle/AngleCreator.java +46 -0
  68. package/src/android/app/src/test/java/es/situm/plugin/bounds/BoundsCreator.java +50 -0
  69. package/src/android/app/src/test/java/es/situm/plugin/building/BuildingCreator.java +76 -0
  70. package/src/android/app/src/test/java/es/situm/plugin/cartesianCoordinate/CartesianCoordinateCreator.java +31 -0
  71. package/src/android/app/src/test/java/es/situm/plugin/circle/CircleCreator.java +41 -0
  72. package/src/android/app/src/test/java/es/situm/plugin/coordinate/CoordinateCreator.java +32 -0
  73. package/src/android/app/src/test/java/es/situm/plugin/dimensions/DimensionsCreator.java +31 -0
  74. package/src/android/app/src/test/java/es/situm/plugin/directionsRequest/DirectionsRequestCreator.java +105 -0
  75. package/src/android/app/src/test/java/es/situm/plugin/event/EventCreator.java +108 -0
  76. package/src/android/app/src/test/java/es/situm/plugin/floor/FloorCreator.java +58 -0
  77. package/src/android/app/src/test/java/es/situm/plugin/indication/IndicationCreator.java +40 -0
  78. package/src/android/app/src/test/java/es/situm/plugin/location/LocationCreator.java +197 -0
  79. package/src/android/app/src/test/java/es/situm/plugin/locationRequest/LocationRequestCreator.java +45 -0
  80. package/src/android/app/src/test/java/es/situm/plugin/locationStatus/LocationStatusCreator.java +211 -0
  81. package/src/android/app/src/test/java/es/situm/plugin/navigationProgress/NavigationProgressCreator.java +154 -0
  82. package/src/android/app/src/test/java/es/situm/plugin/poi/PoiCreator.java +126 -0
  83. package/src/android/app/src/test/java/es/situm/plugin/poiCategory/PoiCategoryCreator.java +38 -0
  84. package/src/android/app/src/test/java/es/situm/plugin/point/PointCreator.java +200 -0
  85. package/src/android/app/src/test/java/es/situm/plugin/route/RouteCreator.java +142 -0
  86. package/src/android/app/src/test/java/es/situm/plugin/routeStep/RouteStepCreator.java +173 -0
  87. package/src/android/app/src/test/java/es/situm/plugin/situmConversionArea/SitumConversionAreaCreator.java +35 -0
  88. package/src/android/build.gradle +31 -0
  89. package/src/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  90. package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  91. package/src/android/gradle.properties +16 -0
  92. package/src/android/gradlew +172 -0
  93. package/src/android/gradlew.bat +84 -0
  94. package/src/android/settings.gradle +3 -0
  95. package/src/android/situm.gradle +19 -0
  96. package/src/ios/Classes/Private/CDVDebug.h +25 -0
  97. package/src/ios/Classes/Private/CDVJSON_private.h +31 -0
  98. package/src/ios/Classes/Private/CDVJSON_private.m +99 -0
  99. package/src/ios/Classes/Private/CDVPlugin+Private.h +24 -0
  100. package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.h +26 -0
  101. package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.m +70 -0
  102. package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.h +27 -0
  103. package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.m +86 -0
  104. package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h +34 -0
  105. package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +153 -0
  106. package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.h +50 -0
  107. package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.m +487 -0
  108. package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.h +26 -0
  109. package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.m +37 -0
  110. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h +41 -0
  111. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +399 -0
  112. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h +27 -0
  113. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m +202 -0
  114. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h +29 -0
  115. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +153 -0
  116. package/src/ios/Classes/Public/CDV.h +32 -0
  117. package/src/ios/Classes/Public/CDVAppDelegate.h +28 -0
  118. package/src/ios/Classes/Public/CDVAppDelegate.m +118 -0
  119. package/src/ios/Classes/Public/CDVAvailability.h +111 -0
  120. package/src/ios/Classes/Public/CDVAvailabilityDeprecated.h +26 -0
  121. package/src/ios/Classes/Public/CDVCommandDelegate.h +51 -0
  122. package/src/ios/Classes/Public/CDVCommandDelegateImpl.h +36 -0
  123. package/src/ios/Classes/Public/CDVCommandDelegateImpl.m +186 -0
  124. package/src/ios/Classes/Public/CDVCommandQueue.h +39 -0
  125. package/src/ios/Classes/Public/CDVCommandQueue.m +194 -0
  126. package/src/ios/Classes/Public/CDVConfigParser.h +30 -0
  127. package/src/ios/Classes/Public/CDVConfigParser.m +81 -0
  128. package/src/ios/Classes/Public/CDVInvokedUrlCommand.h +52 -0
  129. package/src/ios/Classes/Public/CDVInvokedUrlCommand.m +116 -0
  130. package/src/ios/Classes/Public/CDVPlugin+Resources.h +39 -0
  131. package/src/ios/Classes/Public/CDVPlugin+Resources.m +38 -0
  132. package/src/ios/Classes/Public/CDVPlugin.h +85 -0
  133. package/src/ios/Classes/Public/CDVPlugin.m +202 -0
  134. package/src/ios/Classes/Public/CDVPluginResult.h +66 -0
  135. package/src/ios/Classes/Public/CDVPluginResult.m +186 -0
  136. package/src/ios/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
  137. package/src/ios/Classes/Public/CDVTimer.h +27 -0
  138. package/src/ios/Classes/Public/CDVTimer.m +123 -0
  139. package/src/ios/Classes/Public/CDVURLProtocol.h +27 -0
  140. package/src/ios/Classes/Public/CDVURLProtocol.m +113 -0
  141. package/src/ios/Classes/Public/CDVUserAgentUtil.h +27 -0
  142. package/src/ios/Classes/Public/CDVUserAgentUtil.m +124 -0
  143. package/src/ios/Classes/Public/CDVViewController.h +92 -0
  144. package/src/ios/Classes/Public/CDVViewController.m +821 -0
  145. package/src/ios/Classes/Public/CDVWebViewEngineProtocol.h +42 -0
  146. package/src/ios/Classes/Public/CDVWhitelist.h +34 -0
  147. package/src/ios/Classes/Public/CDVWhitelist.m +285 -0
  148. package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
  149. package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
  150. package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.h +29 -0
  151. package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.m +58 -0
  152. package/src/ios/Cordova/Cordova.h +51 -0
  153. package/src/ios/Cordova/Info.plist +24 -0
  154. package/src/ios/Podfile +5 -0
  155. package/src/ios/SitumCordovaPlugin.xcodeproj/project.pbxproj +1324 -0
  156. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  157. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  158. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  159. package/src/ios/SitumCordovaPlugin.xcodeproj/xcshareddata/xcschemes/CordovaLib.xcscheme +100 -0
  160. package/src/ios/SitumCordovaPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  161. package/src/ios/SitumCordovaPlugin_Prefix.pch +22 -0
  162. package/src/ios/VERSION +1 -0
  163. package/src/ios/cordova.js +2432 -0
  164. package/src/ios/situmcordovaplugin/AppDelegate.h +22 -0
  165. package/src/ios/situmcordovaplugin/AppDelegate.m +98 -0
  166. package/src/ios/situmcordovaplugin/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
  167. package/src/ios/situmcordovaplugin/Base.lproj/LaunchScreen.storyboard +25 -0
  168. package/src/ios/situmcordovaplugin/Base.lproj/Main.storyboard +24 -0
  169. package/src/ios/situmcordovaplugin/Constants.h +14 -0
  170. package/src/ios/situmcordovaplugin/Constants.m +14 -0
  171. package/src/ios/situmcordovaplugin/Info.plist +45 -0
  172. package/src/ios/situmcordovaplugin/SITUtils.h +7 -0
  173. package/src/ios/situmcordovaplugin/SITUtils.m +13 -0
  174. package/src/ios/situmcordovaplugin/SitumLocationWrapper.h +109 -0
  175. package/src/ios/situmcordovaplugin/SitumLocationWrapper.m +983 -0
  176. package/src/ios/situmcordovaplugin/SitumPlugin.h +41 -0
  177. package/src/ios/situmcordovaplugin/SitumPlugin.m +752 -0
  178. package/src/ios/situmcordovaplugin/ViewController.h +15 -0
  179. package/src/ios/situmcordovaplugin/ViewController.m +29 -0
  180. package/src/ios/situmcordovaplugin/main.m +16 -0
  181. package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/.xccurrentversion +8 -0
  182. package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/situmcordovaplugin.xcdatamodel/contents +4 -0
  183. package/src/ios/situmcordovaplugintests/AngleTests.m +53 -0
  184. package/src/ios/situmcordovaplugintests/BoundTests.m +51 -0
  185. package/src/ios/situmcordovaplugintests/BuildingTests.m +41 -0
  186. package/src/ios/situmcordovaplugintests/CartesianCoordinateTests.m +42 -0
  187. package/src/ios/situmcordovaplugintests/ConversionAreaTests.m +43 -0
  188. package/src/ios/situmcordovaplugintests/CoordinateTests.m +42 -0
  189. package/src/ios/situmcordovaplugintests/DimensionTests.m +43 -0
  190. package/src/ios/situmcordovaplugintests/EventTests.m +42 -0
  191. package/src/ios/situmcordovaplugintests/FloorTests.m +52 -0
  192. package/src/ios/situmcordovaplugintests/Info.plist +38 -0
  193. package/src/ios/situmcordovaplugintests/InputTests/DirectionsRequestTest.m +108 -0
  194. package/src/ios/situmcordovaplugintests/InputTests/InputCartesianCoordinateTests.m +45 -0
  195. package/src/ios/situmcordovaplugintests/InputTests/InputCoordinateTests.m +45 -0
  196. package/src/ios/situmcordovaplugintests/InputTests/InputFloorTests.m +59 -0
  197. package/src/ios/situmcordovaplugintests/InputTests/InputIndicationTests.m +45 -0
  198. package/src/ios/situmcordovaplugintests/InputTests/InputLocationTests.m +163 -0
  199. package/src/ios/situmcordovaplugintests/InputTests/InputPoiCategoryTests.m +46 -0
  200. package/src/ios/situmcordovaplugintests/InputTests/InputPointTests.m +137 -0
  201. package/src/ios/situmcordovaplugintests/InputTests/LocationRequestTest.m +79 -0
  202. package/src/ios/situmcordovaplugintests/LocationStatusTests.m +60 -0
  203. package/src/ios/situmcordovaplugintests/LocationTests.m +114 -0
  204. package/src/ios/situmcordovaplugintests/NavigationProgressTests.m +50 -0
  205. package/src/ios/situmcordovaplugintests/PoiCategoryIconTests.m +43 -0
  206. package/src/ios/situmcordovaplugintests/PoiCategoryTests.m +42 -0
  207. package/src/ios/situmcordovaplugintests/PoiTests.m +83 -0
  208. package/src/ios/situmcordovaplugintests/PointTests.m +107 -0
  209. package/src/ios/situmcordovaplugintests/RouteStepTests.m +78 -0
  210. package/src/ios/situmcordovaplugintests/RouteTests.m +42 -0
  211. package/src/ios/situmcordovaplugintests/SitumCreatorTests.h +91 -0
  212. package/src/ios/situmcordovaplugintests/SitumCreatorTests.m +928 -0
  213. package/src/ios/situmcordovaplugintests/TestingHelper.h +48 -0
  214. package/src/ios/situmcordovaplugintests/TestingHelper.m +342 -0
  215. package/src/ios/situmcordovaplugintests/indicationTests.m +43 -0
  216. package/tests/common-resources/angle/angle1.json +6 -0
  217. package/tests/common-resources/angle/angle2.json +6 -0
  218. package/tests/common-resources/bounds/bounds1.json +18 -0
  219. package/tests/common-resources/bounds/bounds2.json +18 -0
  220. package/tests/common-resources/building/building1.json +64 -0
  221. package/tests/common-resources/cartesianCoordinate/cartesianCoordinate1.json +4 -0
  222. package/tests/common-resources/circle/circle1.json +17 -0
  223. package/tests/common-resources/coordinate/coordinate1.json +4 -0
  224. package/tests/common-resources/dimensions/dimensions1.json +4 -0
  225. package/tests/common-resources/directionsRequest/directionsRequest1.json +166 -0
  226. package/tests/common-resources/directionsRequest/directionsRequest2.json +167 -0
  227. package/tests/common-resources/directionsRequest/directionsRequest3.json +166 -0
  228. package/tests/common-resources/directionsRequest/directionsRequest4.json +166 -0
  229. package/tests/common-resources/directionsRequest/directionsRequest5.json +167 -0
  230. package/tests/common-resources/directionsRequest/directionsRequest6.json +153 -0
  231. package/tests/common-resources/events/event1.json +66 -0
  232. package/tests/common-resources/floor/floor1.json +13 -0
  233. package/tests/common-resources/floor/floor2.json +13 -0
  234. package/tests/common-resources/indication/indication1.json +10 -0
  235. package/tests/common-resources/location/location1.json +48 -0
  236. package/tests/common-resources/location/location10.json +48 -0
  237. package/tests/common-resources/location/location2.json +48 -0
  238. package/tests/common-resources/location/location3.json +48 -0
  239. package/tests/common-resources/location/location4.json +48 -0
  240. package/tests/common-resources/location/location5.json +48 -0
  241. package/tests/common-resources/location/location6.json +48 -0
  242. package/tests/common-resources/location/location7.json +48 -0
  243. package/tests/common-resources/location/location8.json +48 -0
  244. package/tests/common-resources/location/location9.json +48 -0
  245. package/tests/common-resources/locationRequest/locationRequest1.json +6 -0
  246. package/tests/common-resources/locationRequest/locationRequest2.json +32 -0
  247. package/tests/common-resources/locationRequest/locationRequest3.json +33 -0
  248. package/tests/common-resources/locationRequest/locationRequest4.json +31 -0
  249. package/tests/common-resources/locationStatus/locationStatus1.json +4 -0
  250. package/tests/common-resources/locationStatus/locationStatus10.json +4 -0
  251. package/tests/common-resources/locationStatus/locationStatus11.json +4 -0
  252. package/tests/common-resources/locationStatus/locationStatus12.json +4 -0
  253. package/tests/common-resources/locationStatus/locationStatus13.json +4 -0
  254. package/tests/common-resources/locationStatus/locationStatus2.json +4 -0
  255. package/tests/common-resources/locationStatus/locationStatus3.json +4 -0
  256. package/tests/common-resources/locationStatus/locationStatus4.json +4 -0
  257. package/tests/common-resources/locationStatus/locationStatus5.json +4 -0
  258. package/tests/common-resources/locationStatus/locationStatus6.json +4 -0
  259. package/tests/common-resources/locationStatus/locationStatus7.json +4 -0
  260. package/tests/common-resources/locationStatus/locationStatus8.json +4 -0
  261. package/tests/common-resources/locationStatus/locationStatus9.json +4 -0
  262. package/tests/common-resources/navigationProgress/navigationProgress1.json +77 -0
  263. package/tests/common-resources/navigationProgress/navigationProgress2.json +77 -0
  264. package/tests/common-resources/poi/poi1.json +35 -0
  265. package/tests/common-resources/poi/poi2.json +35 -0
  266. package/tests/common-resources/poi/poi3.json +35 -0
  267. package/tests/common-resources/poi/poi4.json +38 -0
  268. package/tests/common-resources/poi/poi5.json +35 -0
  269. package/tests/common-resources/poiCategory/poiCategory1.json +7 -0
  270. package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.json +1 -0
  271. package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.png +0 -0
  272. package/tests/common-resources/point/point1.json +14 -0
  273. package/tests/common-resources/point/point2.json +14 -0
  274. package/tests/common-resources/point/point3.json +14 -0
  275. package/tests/common-resources/point/point4.json +14 -0
  276. package/tests/common-resources/point/point5.json +14 -0
  277. package/tests/common-resources/point/point6.json +14 -0
  278. package/tests/common-resources/point/point7.json +14 -0
  279. package/tests/common-resources/point/point8.json +14 -0
  280. package/tests/common-resources/route/route1.json +530 -0
  281. package/tests/common-resources/routeStep/routeStep1.json +35 -0
  282. package/tests/common-resources/routeStep/routeStep2.json +35 -0
  283. package/tests/common-resources/routeStep/routeStep3.json +35 -0
  284. package/tests/common-resources/routeStep/routeStep4.json +35 -0
  285. package/tests/common-resources/routeStep/routeStep5.json +35 -0
  286. package/tests/common-resources/situmConversionArea/situmConversionArea1.json +19 -0
  287. package/tests/js/resources/fetchBuildings.json +176 -0
  288. package/tests/js/resources/fetchEventsFromBuilding.json +201 -0
  289. package/tests/js/resources/fetchFloorsFromBuilding.json +34 -0
  290. package/tests/js/resources/fetchIndoorPOIsFromBuilding.json +574 -0
  291. package/tests/js/resources/fetchMapFromFloor.json +3 -0
  292. package/tests/js/resources/fetchOutdoorPOIsFromBuilding.json +68 -0
  293. package/tests/js/resources/fetchPoiCategories.json +72 -0
  294. package/tests/js/resources/fetchPoiCategoryIconNormal.json +3 -0
  295. package/tests/js/resources/fetchPoiCategoryIconSelected.json +3 -0
  296. package/tests/js/resources/requestDirections.json +1167 -0
  297. package/tests/js/resources/startPositioning/0_starting.json +4 -0
  298. package/tests/js/resources/startPositioning/1_preparingPositioningModel.json +4 -0
  299. package/tests/js/resources/startPositioning/2_startingPositioning.json +4 -0
  300. package/tests/js/resources/startPositioning/3_calculating.json +4 -0
  301. package/tests/js/resources/startPositioning/4_position.json +48 -0
  302. package/tests/js/resources/startPositioning/5_position.json +48 -0
  303. package/tests/js/test.js +416 -0
  304. package/tests/scripts/clean_android_resources.sh +3 -0
  305. package/tests/scripts/clean_ios_resources.sh +3 -0
  306. package/tests/scripts/copy_android_resources.sh +3 -0
  307. package/tests/scripts/copy_ios_resources.sh +3 -0
  308. package/tests/scripts/self-destruct.sh +1 -0
  309. package/www/android/Interfaces.js +742 -0
  310. package/www/android/situm.js +296 -0
  311. package/www/ios/situm.js +99 -0
  312. package/www/map-view-controller.js +223 -0
  313. package/www/map-view.js +88 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # Changelog
2
+
3
+ Please refer to the [Cordova SDK Changelog](https://situm.com/docs/cordova-sdk-changelog/) in our documentation.
@@ -0,0 +1,28 @@
1
+ # Version 3.0.0 – November 22, 2023
2
+
3
+ Introducing the new [@situm/cordova](https://www.npmjs.com/package/@situm/cordova) 3.0.0!.
4
+
5
+ We are thrilled to announce the release of [@situm/cordova](https://www.npmjs.com/package/@situm/cordova), a remarkable evolution and improvement upon our previous versions. With this update, we are taking a leap forward to provide you with a future-ready solution.
6
+
7
+ We’ve been listening to our customers’ feedback, and we have incorporated a wide range of enhancements based on your valuable input. Checkout the [Situm page](https://situm.com/en/blog-eng/situm-indoor-positioning-product-news/situm-wyf-3-0-revolutionizing-indoor-navigation-maps-2/) for further details.
8
+
9
+ As this library includes significant changes, we have prepared comprehensive documentation guide on how to create a app with our new visual component, [<map-view>](https://situm.com/docs/a-basic-cordova-app/). You might found the following links helpful:
10
+
11
+ - [API reference](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/situm). Learn how to communicate with our API.
12
+ - [Capacitor example application](https://github.com/situmtech/cordova/tree/master/example). Try our plugin with just a few steps in our sample app!
13
+
14
+ We are incredibly grateful for your continued support and trust in our library. [@situm/cordova](https://www.npmjs.com/package/@situm/cordova) represents our commitment to empowering developers with the most advanced tools and ensuring a brighter future for your software development endeavors.
15
+
16
+ Thank you for being part of this exciting journey with us!
17
+
18
+ **Added**
19
+
20
+ The new [@situm/cordova](https://www.npmjs.com/package/@situm/cordova) introduces a new visual component, [<map-view>](https://situm.com/docs/map-viewer-quickstart-guide/), to provide interactive maps within your application. The <map-view> allows you to show indoor maps of your buildings on your app! It is a fully interactive HTMLElement with improved capabilities:
21
+ - Intuitive Guidance with Dynamic and Static Navigation.
22
+ - Advanced POI Display Based on Zoom Level and Density.
23
+ - “What’s Nearby” Exploration Made Easy with Category & Subcategory Filtering, and POI search.
24
+ - POI information visualization.
25
+ - Tailored User Experience with High Configurability.
26
+ - Out of the box support for raster floorplans, raster tiles and GeoJSON/IMDF floorplans.
27
+ - Multilingual Interface.
28
+ - This new version lays the foundation for future improvements, specifically enabling full 3D maps and even augmented reality capabilities.
package/Jenkinsfile ADDED
@@ -0,0 +1,84 @@
1
+ node('ios') {
2
+ stage('Checkout SCM') {
3
+ checkout scm
4
+ }
5
+
6
+ try {
7
+ stage ('iOS test') {
8
+ sh "tests/scripts/copy_ios_resources.sh"
9
+ sh "scripts/update_iosSDK_version.sh ."
10
+ sh "cd src/ios && pod repo update && pod install && xcodebuild test -workspace SitumCordovaPlugin.xcworkspace -scheme CordovaLib -destination 'platform=iOS Simulator,name=iPhone 7,OS=11.2'"
11
+ }
12
+ } finally {
13
+ stage('clean repo') {
14
+ sh "tests/scripts/self-destruct.sh"
15
+ }
16
+ }
17
+
18
+ }
19
+
20
+ node('androidci') {
21
+ stage('Checkout SCM') {
22
+ checkout scm
23
+ }
24
+
25
+ stage('Clean Android'){
26
+ sh "cd src/android && ./gradlew clean"
27
+ }
28
+
29
+ try {
30
+ stage('Android test') {
31
+ sh "tests/scripts/copy_android_resources.sh"
32
+ sh "cd src/android && ./gradlew test --continue"
33
+ }
34
+ } finally {
35
+ stage('Publish tests') {
36
+ junit 'src/android/app/build/test-results/*/*.xml'
37
+ }
38
+ stage('clean repo') {
39
+ sh "tests/scripts/self-destruct.sh"
40
+ }
41
+ }
42
+ }
43
+
44
+ node('vm1-docker') {
45
+
46
+ stage('Checkout SCM') {
47
+ checkout scm
48
+ }
49
+
50
+ try {
51
+ stage('JS test') {
52
+ def kubectl = docker.image('node:11.12-slim')
53
+ kubectl.pull()
54
+ kubectl.inside("-u 0") {
55
+ sh "npm install"
56
+ sh "npm test"
57
+ }
58
+ }
59
+
60
+ stage('Generate JSDoc') {
61
+ def kubectl = docker.image('node:11.12-slim')
62
+ kubectl.pull()
63
+ kubectl.inside() {
64
+ sh "npm run jsdoc"
65
+ }
66
+ }
67
+
68
+ stage('Archive artifacts'){
69
+ def kubectl = docker.image('node:11.12-slim')
70
+ kubectl.inside("-u 0") {
71
+ sh "apt-get update && apt-get --assume-yes install zip"
72
+ sh "zip -r JSDoc ./docs/JSDoc/*"
73
+ archiveArtifacts "JSDoc.zip"
74
+ }
75
+ }
76
+ } finally {
77
+ stage('Clean repo'){
78
+ def kubectl = docker.image('node:11.12-slim')
79
+ kubectl.inside("-u 0") {
80
+ sh "tests/scripts/self-destruct.sh"
81
+ }
82
+ }
83
+ }
84
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Situm Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,472 @@
1
+ <div style="text-align:center">
2
+
3
+ # Situm Cordova Plugin
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![npm](https://img.shields.io/npm/v/@situm/cordova.svg)](https://www.npmjs.com/package/@situm/cordova)
6
+ [![npm](https://img.shields.io/npm/dm/@situm/cordova.svg)](https://www.npmjs.com/package/@situm/cordova)
7
+ </div>
8
+ <div style="float:right; margin-left: 1rem;">
9
+
10
+ [![](https://situm.com/wp-content/themes/situm/img/logo-situm.svg)](https://www.situm.es)
11
+ </div>
12
+
13
+ Situm Cordova Plugin is a set of utilities that allow any developer to build Cordova location based apps using Situm's indoor positioning system. Among many other capabilities, apps developed with Situm Cordova Plugin will be able to:
14
+ * Obtain information related to buildings where Situm's positioning system is already configured: floorplans, points of interest, geotriggered events, etc.
15
+ * Retrieve the location of the smartphone inside these buildings (position, orientation, and floor where the smartphone is).
16
+ * Compute a route from a point A (e.g. where the smartphone is) to a point B (e.g. any point of interest within the building).
17
+ * Trigger notifications when the user enters a certain area.
18
+
19
+
20
+ ## Table of contents
21
+
22
+ * [Getting started](#getting-started)
23
+ * [Versioning](#versioning)
24
+ * [Submitting contributions](#submitting-contributions)
25
+ * [License](#license)
26
+ * [Documentation](#documentation)
27
+ * [Development](#development)
28
+ * [More information](#more-information)
29
+ * [Support information](#support-information)
30
+
31
+ ---
32
+
33
+ ## Getting started
34
+
35
+ - Set up your Situm account following [these steps](https://situm.com/docs/01-introduction/#3-toc-title).
36
+ - [Configure](https://situm.com/docs/a-basic-cordova-app/) this plugin in your project.
37
+ - [API Reference](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/situm) will help you use a particular class or method.
38
+
39
+ ---
40
+
41
+ ## Versioning
42
+
43
+ Please refer to [CHANGELOG.md](https://github.com/situmtech/situm-cordova-plugin/blob/master/CHANGELOG.md) for a list of notables changes for each version of the plugin.
44
+
45
+ You can also see the [tags on this repository](https://github.com/situmtech/situm-cordova-plugin/tags).
46
+
47
+ ---
48
+
49
+ ## Submitting contributions
50
+
51
+ You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://situm.com/contributions/).
52
+
53
+ ---
54
+
55
+ ## License
56
+
57
+ Situm-Cordova-Plugin is licensed under [MIT License](https://opensource.org/licenses/MIT). See [LICENSE.txt](https://github.com/situmtech/situm-cordova-plugin/blob/master/LICENSE) file for further details.
58
+
59
+ ---
60
+
61
+ ## Documentation
62
+
63
+ - **General documentation**. You can find in our [documentation site](https://situm.com/docs/a-basic-cordova-app/) all the information you need to configure this plugin in your project and get it up and running in no time.
64
+ - **API reference**. Check out the [plugin reference](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/situm) and learn how to use a particular class or method.
65
+ - **Examples**. In [this repo](https://github.com/situmtech/situm-cordova-getting-started) you can find a sample app implementing this plugin. Take a look at how the examples are implemented, so you can figure out how to adapt it to your project.
66
+ - **Cordova Wayfinding plugin**. If you are looking for a wayfinding solution using Cordova, check out [this repo](https://github.com/situmtech/situm-cordova-plugin-wayfinding).
67
+
68
+ ### Methods
69
+
70
+ NOTE: This plugin is currently under development. There may be method not implemented yet. Also there may be some API changes as development progresses.
71
+
72
+ #### - setApiKey
73
+
74
+ Log in into your Situm Account. This key is generated in Situm Dashboard. Return true if apiKey was set successfully, otherwise false
75
+
76
+ ```js
77
+ cordova.plugins.Situm.setApiKey("SITUM_EMAIL", "SITUM_API_KEY");
78
+ ```
79
+
80
+ #### - setUserPass
81
+
82
+ Provides user's email and password. Return true if apiKey was set successfully, otherwise false
83
+ ```js
84
+ cordova.plugins.Situm.setUserPass("SITUM_EMAIL", "SITUM_USER_PASS");
85
+ ```
86
+
87
+ #### - setRemoteConfig
88
+
89
+ Set the remote configuration state which allows to use the configuration (location request) stored on the web to find the location of the user.
90
+ ```js
91
+ cordova.plugins.Situm.setUseRemoteConfig(true);
92
+ ```
93
+
94
+ #### - setCacheMaxAge
95
+
96
+ Sets the maximum age of a cached response in seconds.
97
+ ```js
98
+ cordova.plugins.Situm.setCacheMaxAge(1*60*60) // 1 hour
99
+ ```
100
+
101
+ #### - startPositioning
102
+
103
+ Starts the positioning system. In the success callback it can return:
104
+ * [Location](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Location)
105
+ * [LocationStatus](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#LocationStatus)
106
+ ```js
107
+ locationOptions = {
108
+ buildingIdentifier = "BUILDING_ID"
109
+ };
110
+
111
+ cordova.plugins.Situm.startPositioning(locationOptions, (res: any) => {
112
+ if (res && res.statusName) {
113
+ // Returns location status
114
+ }
115
+ if (res && res.position) {
116
+ // Return location object
117
+ }
118
+ }, (err: any) => {
119
+ //Return error as an string.If this happens the positioning is stopped
120
+ });
121
+ ```
122
+
123
+ #### - stopPositioning
124
+
125
+ Stop the positioning system on current active listener.
126
+ ```js
127
+ cordova.plugins.Situm.stopPositioning()
128
+ ```
129
+
130
+ #### - fetchBuildings
131
+
132
+ Download all the buildings for the current user.Returns an array of [buildings](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Building)
133
+
134
+ ```js
135
+ cordova.plugins.Situm.fetchBuildings((res: any) => {
136
+ // Return an array of buildings
137
+ }, (err: any) => {
138
+ // returns error string
139
+ });
140
+ ```
141
+
142
+ ### - fetchBuildingInfo
143
+
144
+ Download the information (floors, pois, ...) [of a building](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#BuildingInfo)
145
+
146
+ ```js
147
+ cordova.plugins.Situm.fetchBuildingInfo(building,(res: any) => {
148
+ // Return the buildingInfo
149
+ }, (err: any) => {
150
+ // returns error string
151
+ });
152
+ ```
153
+
154
+ #### - fetchFloorsFromBuilding
155
+
156
+ Download all the [floors](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Floor) of a building.
157
+
158
+ ```js
159
+ cordova.plugins.Situm.fetchFloorsFromBuilding(building,(res: any) => {
160
+ // Return an array of floors
161
+ }, (err: any) => {
162
+ // returns error string
163
+ });
164
+ ```
165
+
166
+ #### - fetchIndoorPOIsFromBuilding
167
+
168
+ Download the indoor [POIs](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#POI) of a building.
169
+
170
+ ```js
171
+ cordova.plugins.Situm.fetchIndoorPOIsFromBuilding(building,(res: any) => {
172
+ // Return an array of indoor POIs
173
+ }, (err: any) => {
174
+ // returns error string
175
+ });
176
+ ```
177
+
178
+ #### - fetchOutdoorPOIsFromBuilding
179
+
180
+ Download the outdoor [POIs](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#POI) of a building.
181
+
182
+ ```js
183
+ cordova.plugins.Situm.fetchOutdoorPOIsFromBuilding(building,(res: any) => {
184
+ // Return an array of outdoor POIs
185
+ }, (err: any) => {
186
+ // returns error string
187
+ });
188
+ ```
189
+
190
+ #### - fetchEventsFromBuilding
191
+
192
+ Download the [events](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#SitumEvent) of a building.
193
+
194
+ ```js
195
+ cordova.plugins.Situm.fetchEventsFromBuilding(building,(res: any) => {
196
+ // Return an array of events
197
+ }, (err: any) => {
198
+ // returns error string
199
+ });
200
+ ```
201
+ #### - fetchPoiCategories
202
+
203
+ Get all [POI Categories](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#PoiCategory), download and cache their icons asynchronously.
204
+
205
+ ```js
206
+ cordova.plugins.Situm.fetchPoiCategories((res: any) => {
207
+ // Return an array of POI categories
208
+ }, (err: any) => {
209
+ // returns error string
210
+ });
211
+ ```
212
+
213
+ #### - fetchMapFromFloor
214
+
215
+ Download the map image of a floor.
216
+
217
+ ```js
218
+ cordova.plugins.Situm.fetchMapFromFloor(floor, (res: any) => {
219
+ // Return an image as an string encoded in Base64
220
+ }, (err: any) => {
221
+ // returns error string
222
+ });
223
+ ```
224
+
225
+ #### - fetchPoiCategoryIconNormal
226
+
227
+ Get the normal category icon for a POICategory.
228
+
229
+ ```js
230
+ cordova.plugins.Situm.fetchPoiCategoryIconNormal(category, (res: any) => {
231
+ // Return an image as an string encoded in Base64
232
+ }, (err: any) => {
233
+ // returns error string
234
+ });
235
+ ```
236
+
237
+ #### - fetchPoiCategoryIconSelected
238
+
239
+ Get the selected category icon for a POICategory.
240
+
241
+ ```js
242
+ cordova.plugins.Situm.fetchPoiCategoryIconSelected(category, (res: any) => {
243
+ // Return an image as an string encoded in Base64
244
+ }, (err: any) => {
245
+ // returns error string
246
+ });
247
+ ```
248
+
249
+ #### - fetchGeofencesFromBuilding
250
+
251
+ Get all [geofences](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Geofence) from the building.
252
+
253
+ ```js
254
+ cordova.plugins.Situm.fetchGeofencesFromBuilding(building, (res: any) => {
255
+ // Return an array of geofences
256
+ }, (err: any) => {
257
+ // returns error string
258
+ });
259
+ ```
260
+
261
+
262
+ #### - invalidateCache
263
+
264
+ Invalidate all the resources in the cache.
265
+
266
+ ```js
267
+ cordova.plugins.Situm.invalidateCache();
268
+ ```
269
+
270
+ #### - requestDirections
271
+
272
+ Calculates a route between two points. This route is the one that will be used when you call requestNavigationUpdates. If this method is called multiple times the last Route will be used.
273
+ You can change the options to generate the Route with [DirectionOptions](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#DirectionsOptions)
274
+ Returns a [Route](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Route)
275
+ ```js
276
+ directionRequest = [
277
+ building, // Building in which you're positioning
278
+ from, // Point where you want to start the route. You can pass a Point or a Location
279
+ to, // Point where you want to finish the route
280
+ {} // Options to generate the route
281
+ ]
282
+
283
+
284
+ cordova.plugins.Situm.requestDirections(
285
+ directionsRequest, (route: any) => {
286
+ //Return a Route
287
+ }, (err: any) => {
288
+ // returns error string
289
+ });
290
+ ```
291
+
292
+ #### - requestNavigationUpdates
293
+
294
+ Necessary step to request progress. Alone this method does not provide progress object. You must feed navigation API with location, as indicated on updateNavigationWithLocation section.
295
+ When you start feeding locations you can receive [NavigationProgress](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#NavigationProgress) or other of the results described below
296
+
297
+ ```js
298
+ // Navigation request with example values
299
+ navigationRequest = [
300
+ distanceToGoalThreshold = 10,
301
+ distanceToFloorChangeThreshold = 5
302
+ ]
303
+ cordova.plugins.Situm.requestNavigationUpdates(
304
+ navigationRequest,
305
+ (navigation: any) => {
306
+ /**
307
+ * This callback can return four different things:
308
+ * 1. A message notifying about the success starting the navigation
309
+ * 2. A json with the NavigationProgress. The Json will also have a field "type" with the value "progress" so you can know when this happens.
310
+ * 3. A json with the field "type" and the value "destinationReached". This happens when the navigation finish because you reached the end.
311
+ * 4. A json with the field "type" and the value "userOutsideRoute". This happens when the user deviate from the route. You can notify them so they return to the correct path.
312
+ */
313
+ },
314
+ (error: any) => {
315
+ //returns error string
316
+ });
317
+ ```
318
+
319
+ #### - updateNavigationWithLocation
320
+
321
+ Usually, position variable should be one of the locations provided by the system on the [startPositioning](#--startpositioning) function.
322
+
323
+ ```js
324
+ cordova.plugins.Situm.updateNavigationWithLocation(currentLocation)
325
+ ```
326
+
327
+ #### - removeNavigationUpdates
328
+
329
+ When you are no longer interested on Navigation Updates you should call this method to remove internal allocated resources.
330
+
331
+ ```js
332
+ cordova.plugins.Situm.removeNavigationUpdates();
333
+ ```
334
+
335
+ #### - requestRealTimeUpdates
336
+
337
+ Emits the [real time](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#RealTimeData) location of devices
338
+
339
+ ```js
340
+ const request = {
341
+ building: building, //Building in which you want to be notified
342
+ pollTime: 3000, // time in milliseconds
343
+ }
344
+ cordova.plugins.Situm.SitumPlugin.requestRealTimeUpdates(
345
+ request,
346
+ (locations: any) => {
347
+ // returns the locations of the other devices in real time
348
+ },
349
+ (error: any) => {
350
+ // returns error string
351
+ }
352
+ );
353
+ ```
354
+
355
+ #### - removeRealTimeUpdates
356
+
357
+ When you are no longer interested on realtime location Updates you should call this method to remove internal allocated resources.
358
+
359
+ ```js
360
+ cordova.plugins.Situm.removeRealTimeUpdates();
361
+ ```
362
+
363
+ #### - onEnterGeofences
364
+
365
+ Get notified about users entering geofences. Take into account:
366
+
367
+ - This method must be called **before** the positioning is started.
368
+ - Positioning geofences (with `trainer_metadata` custom field [configured in the dashboard](https://situm.com/docs/special-custom-fields/#activating-the-uncalibrated-indoor-geolocation-mode)) won't be notified.
369
+ - This callback works only with indoor locations. Any outdoor location will produce a call to [onExitedGeofences](#--onExitedGeofences) with the last positioned geofences as argument.
370
+ - This callback will return an array of [geofences](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Geofence)
371
+
372
+ ```js
373
+ cordova.plugins.Situm.onEnterGeofences((geofences: any) => {
374
+ // Returns an array of geofences
375
+ // e.g. [{"polygonPoints": [], "customFields": {}, "updatedAt": "Thu Jan 01 01:00:00 +0100 1970", "buildingIdentifier": "1234", "floorIdentifier": "123456", "code": "", "createdAt": "Thu Jan 01 01:00:00 +0100 1970", "infoHtml": "", "name": "My Geofence", "identifier": "12345678-aaaa-bbbb-cccc-12345678abcd"}]
376
+ });
377
+ ```
378
+
379
+ #### - onExitGeofences
380
+
381
+ Get notified about exiting geofences. Take into account the considerations described at [onEnterGeofences](#--onEnterGeofences).
382
+ - This callback will return an array of [geofences](https://developers.situm.com/sdk_documentation/cordova/jsdoc/latest/global.html#Geofence)
383
+
384
+ ```js
385
+ cordova.plugins.Situm.onExitGeofences((geofences: any) => {
386
+ // Returns an array of geofences
387
+ // e.g. [{"polygonPoints": [], "customFields": {}, "updatedAt": "Thu Jan 01 01:00:00 +0100 1970", "buildingIdentifier": "1234", "floorIdentifier": "123456", "code": "", "createdAt": "Thu Jan 01 01:00:00 +0100 1970", "infoHtml": "", "name": "My Geofence", "identifier": "12345678-aaaa-bbbb-cccc-12345678abcd"}]
388
+ });
389
+ ```
390
+
391
+ ---
392
+
393
+ ## Development
394
+
395
+ ### Run javascript tests
396
+
397
+ 1. Install mocha and expect.js:
398
+
399
+ ```javascript
400
+ npm install mocha --save
401
+ npm install expect.js --save
402
+ ```
403
+
404
+ 2. In js tests folder run:
405
+
406
+ ```javascript
407
+ mocha test
408
+ ```
409
+
410
+ #### Dependencies
411
+
412
+ - [mocha](https://www.npmjs.com/package/mocha), needed to run tests.
413
+ - [expect.js](https://www.npmjs.com/package/expect.js), needed to do assertions.
414
+
415
+
416
+
417
+ ### Note for Android platform
418
+
419
+ Situm SDK for Android now compiles and targets sdkVersion 31 (Android 12). To work properly on Android 12 devices and above, the host app must:
420
+ * Target android api 31 or above. In your project `config.xml` file, add `<preference name="android-targetSdkVersion" value="31" />` to the Android platform configuration.
421
+ * Request the runtime permissions `ACCESS_COARSE_LOCATION`, `BLUETOOTH_SCAN` and `BLUETOOTH_CONNECT` (plus `ACCESS_FINE_LOCATION` if you are using [Global Mode](https://situm.com/docs/how-does-situm-work/#5-toc-title)). Remember to also add them to the Android platform section of your `config.xml` file:
422
+ ```xml
423
+ <config-file parent="/manifest" target="AndroidManifest.xml">
424
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
425
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- In Global mode -->
426
+ <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
427
+ <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
428
+ </config-file>
429
+ ```
430
+ * Add `android:exported="true"` to all the intent-filtered components of your `AndroidManifest.xml` file. You can add the following configuration to your `config.xml` to automate this process:
431
+ ```xml
432
+ <edit-config
433
+ file="app/src/main/AndroidManifest.xml"
434
+ target="/manifest/application/activity[@android:name='MainActivity']"
435
+ mode="merge">
436
+ <activity android:exported="true"/>
437
+ </edit-config>
438
+ ```
439
+ * Make sure the `widget` root element of your `config.xml` file declares the Android namespace:
440
+ ```xml
441
+ <widget id="..." version="..."
442
+ ...
443
+ xmlns:android="http://schemas.android.com/apk/res/android">
444
+ ```
445
+ * If you find problems, also make sure the Gradle JDK points to version 11 in your project configuration (recommended Android Studio embedded JDK).
446
+
447
+
448
+
449
+ ### Capacitor compatibility
450
+
451
+ This plugin is compatible with Capacitor 3.0.
452
+
453
+ **Issue**: In iOS, there is a known issue with capacitor-cli 3.2.5 and static cordova plugins https://github.com/ionic-team/capacitor/issues/5142. To solve it use a different version of capacitor cli.
454
+
455
+ If the problem persists, add this plugin to the `staticPlugins` section of your `capacitor.config.json` file:
456
+ ```json
457
+ {
458
+ "cordova": {
459
+ "staticPlugins": [
460
+ "@situm/cordova"
461
+ ]
462
+ }
463
+ }
464
+ ```
465
+
466
+
467
+ ## More information
468
+
469
+ More info is available at our [Developers Page](https://situm.com/docs/01-introduction/).
470
+
471
+ ## Support information
472
+ For any question or bug report, please send an email to [support@situm.es](mailto:support@situm.es)
@@ -0,0 +1,5 @@
1
+ steps:
2
+ - checkout: self
3
+ fetchTags: false
4
+ fetchDepth: 1
5
+ displayName: Checkout repo