Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repositories {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'io.ionic.libs:ioncamera-android:1.0.1'
implementation 'io.ionic.libs:ioncamera-android:1.0.2'

if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
implementation "com.capacitorjs:core:$capacitorVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public void openCamera(final PluginCall call) {
// TODO: Verify provider config exists
imageFileUri = FileProvider.getUriForFile(activity, appId + ".fileprovider", photoFile);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageFileUri);
takePictureIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
} catch (Exception ex) {
call.reject(IMAGE_FILE_SAVE_ERROR, ex);
return;
Expand Down Expand Up @@ -543,7 +544,7 @@ private void writePhoto(File outFile, InputStream is) throws IOException {
private File getTempFile(Uri uri) {
String filename = Uri.parse(Uri.decode(uri.toString())).getLastPathSegment();
if (!filename.contains(".jpg") && !filename.contains(".jpeg")) {
filename += "." + (new java.util.Date()).getTime() + ".jpeg";
filename += "." + new java.util.Date().getTime() + ".jpeg";
}
File cacheDir = context.getCacheDir();
return new File(cacheDir, filename);
Expand Down
Loading