Skip to content

Commit

Permalink
Android permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Román A. Sarria committed Jan 10, 2019
1 parent 441649a commit 9aa1e90
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,7 @@ PhotoViewer.show('http://my_site.com/my_image.jpg', 'Optional Title', options);

(1.1.21)
- Fix Typo in PhotoViewer.js
- Fix Typo in PhotoActivity.java
- Fix Typo in PhotoActivity.java

(1.1.22)
- Ask always for permissions on Android.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com-sarriaroman-photoviewer",
"version": "1.1.21",
"version": "1.1.22",
"description": "This plugin is intended to show a picture from an URL into a Photo Viewer with zoom features.",
"cordova": {
"id": "com-sarriaroman-photoviewer",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8' ?>
<plugin id="com-sarriaroman-photoviewer" version="1.1.21" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="com-sarriaroman-photoviewer" version="1.1.22" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>PhotoViewer</name>
<description>This plugin is intended to show a picture from an URL into a Photo Viewer with zoom features.</description>
<js-module name="PhotoViewer" src="www/PhotoViewer.js">
Expand Down
8 changes: 1 addition & 7 deletions src/android/PhotoViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ public boolean execute(String action, JSONArray args, CallbackContext callbackCo
this.args = args;
this.callbackContext = callbackContext;

boolean requiresExternalPermission = true;
try {
requiresExternalPermission = this.args.getBoolean(2);
} catch (JSONException exception) {
}

if (!requiresExternalPermission || (cordova.hasPermission(READ) && cordova.hasPermission(WRITE))) {
if (cordova.hasPermission(READ) && cordova.hasPermission(WRITE)) {
this.launchActivity();
} else {
this.getPermission();
Expand Down

0 comments on commit 9aa1e90

Please # to comment.