cordova-plugin-mserviceinterface-2.0 1.0.89 → 1.0.90

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-mserviceinterface-2.0",
3
- "version": "1.0.89",
3
+ "version": "1.0.90",
4
4
  "description": "This plugin establishes the connection to the native interface and performs the requested task.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
- xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.89">
3
+ xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-mserviceinterface-2.0" version="1.0.90">
4
4
  <name>mserviceinterface-2.0</name>
5
5
  <description>This plugin establishes the connection to the native interface and performs the requested task.</description>
6
6
  <author>selfservit@gmail.com</author>
@@ -315,7 +315,13 @@ public class CameraActivity extends AppCompatActivity {
315
315
  }
316
316
  return true;
317
317
  }
318
-
318
+ @Override
319
+ public void onBackPressed() {
320
+ Intent intent = new Intent();
321
+ intent.putExtra("result", "cancelled");
322
+ setResult(Activity.RESULT_CANCELED, intent);
323
+ finish();
324
+ }
319
325
  @Override
320
326
  public void onRequestPermissionsResult(int rc, @NonNull String[] perms,
321
327
  @NonNull int[] results) {
@@ -2013,12 +2013,16 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
2013
2013
  } else {
2014
2014
  convertImageTo64BaseString(callback, imagePath, "camera", "");
2015
2015
  }
2016
+ } else {
2017
+ callback.error("failure");
2016
2018
  }
2017
2019
  } else if (resultCode == Activity.RESULT_CANCELED) {
2018
- File file = new File(pictureFilePath);
2019
- if (file.exists()) {
2020
- file.delete();
2021
- }
2020
+ if (pictureFilePath != null && !pictureFilePath.isEmpty()) {
2021
+ File file = new File(pictureFilePath);
2022
+ if (file.exists()) {
2023
+ file.delete();
2024
+ }
2025
+ }
2022
2026
  callback.error("failure");
2023
2027
  } else {
2024
2028
  callback.error(resultCode);