cordova-plugin-unvired-universal-sdk 1.0.5 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-unvired-universal-sdk",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Unvired Cordova Plugin",
5
5
  "scripts": {
6
6
  "build": "webpack -c webpack.config.js",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="cordova-plugin-unvired-universal-sdk" version="1.0.5" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <plugin id="cordova-plugin-unvired-universal-sdk" version="1.0.6" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
3
3
  <name>UnviredSDK</name>
4
4
  <dependency id="cordova-plugin-device" version="^3.0.0" />
5
5
  <dependency id="cordova-plugin-unvired-electron-db" version="0.0.14" />
@@ -74,7 +74,7 @@ var printLogs = false;
74
74
  /**
75
75
  * This gets updated during the build time. Check the build.xml file for the details.
76
76
  */
77
- var PACKAGE_NUMBER = "1.0.5"
77
+ var PACKAGE_NUMBER = "1.0.6"
78
78
 
79
79
  //#endregion
80
80
 
package/www/kernel.js CHANGED
@@ -373,7 +373,7 @@ UMP.prototype.userSettings = async function (success, fail) {
373
373
  const unviredPassword = await UserSettingsManager.getInstance().getFieldValue(UserSettingsFields.unviredPassword);
374
374
  const userSettings = {
375
375
  "UNVIRED_ID": unviredUserId,
376
- "USER_ID": AuthenticationService.loginParameters.username,
376
+ "USER_ID": AuthenticationService.loginParameters.username || unviredUserId,
377
377
  "FULL_NAME": "",
378
378
  "EMAIL": "",
379
379
  "SERVER_URL": AuthenticationService.loginParameters.url,
@@ -438,10 +438,14 @@ UMP.prototype.clearData = async function (success, fail) {
438
438
  /**
439
439
  * Check for Internet connection
440
440
  */
441
- UMP.prototype.hasInternet = function (success, fail) {
441
+ UMP.prototype.hasInternet = async function (success, fail) {
442
442
  try {
443
443
  // TODO: Implement this SettingsPlugin
444
- success(true)
444
+ if (!(await isServerReachable(AuthenticationService.instance.loginParameters.url))) {
445
+ success(false)
446
+ } else {
447
+ success(true)
448
+ }
445
449
  } catch (error) {
446
450
  fail(error)
447
451
  }
@@ -693,9 +697,10 @@ UMP.prototype.dbEndTransaction = async function () {
693
697
  /**
694
698
  * dbSaveWebData - Save Web Database
695
699
  */
696
- UMP.prototype.dbSaveWebData = function (success, fail) {
700
+ UMP.prototype.dbSaveWebData = async function (success, fail) {
697
701
  try {
698
702
  // TODO: Implement this SettingsPlugin
703
+ await DatabaseManager.getInstance().saveWebData();
699
704
  success(true)
700
705
  } catch (error) {
701
706
  fail(error)