Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

add runtime permission requests for external storage and camera #424

Merged
merged 8 commits into from
Mar 15, 2018

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Mar 14, 2018

Adds runtime permission requests for image_picker when image source is set to camera on Android.

partially fixes flutter/flutter#13921

@jonahwilliams
Copy link
Member Author

Made suggested changes - the plugin now correctly registers a listener for permission requests, and launches the camera if that is successful.

activity.startActivityForResult(
cameraModule.getCameraIntent(activity), REQUEST_CODE_CAMERA);
} else {
pendingResult = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this send an error back to the Dart side if the permissions were not granted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - also made sure the example was handling the error

@@ -29,12 +34,14 @@
import java.util.List;

/** Location Plugin */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(optional since this was here before) Would you mind fixing (or removing) this incorrect doc string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.. maybe?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonahwilliams
Copy link
Member Author

going to wait on #425 to fix the deprecations

@collinjackson
Copy link
Contributor

I restarted the tests now that #425 has landed

@MJBrooke
Copy link

Ah, nice one! Literally ran into this issue now myself... Thanks for patching it! :)

@jonahwilliams jonahwilliams merged commit 96bfbc0 into flutter:master Mar 15, 2018
@jonahwilliams jonahwilliams deleted the fix_image_picker branch March 15, 2018 17:18
@goderbauer
Copy link
Member

One thing I forgot to mention: You should probably increase the version number in the pubspec, add an entry to the changelog and push the new version to pub.

jonasbark pushed a commit to jonasbark/plugins that referenced this pull request Mar 20, 2018
* commit 'a404fbfd4842b51b57bc0c6298604cf5674e2c02': (40 commits)
  Update README.md (flutter#430)
  Updated to 0.5.0 (flutter#428)
  AdSizes for AdMob banner ads (flutter#402)
  bump minor version and add changelog entry (flutter#427)
  add fetchProvidersForEmail wrapper (flutter#410)
  Incremental Build Script (flutter#422)
  add runtime permission requests for external storage and camera (flutter#424)
  Fix Dart 2 type error and deprecation (flutter#425)
  Fix a Dart 2 runtime cast failure in firebase_database test (flutter#419)
  Fixed deprecation warnings (flutter#420)
  Fix Dart 2 runtime error in the camera plugin (flutter#417)
  Always use the latest Flutter available (flutter#415)
  Spelling (flutter#411)
  Configure Flutter CI (flutter#383)
  Set SDK constraints to match Flutter beta (flutter#412)
  Remove Gradle artifacts from repo (flutter#414)
  Google maps plugin stub (flutter#405)
  Allow null document snapshot data when document does not exist (flutter#406)
  Fix new formatting errors (flutter#408)
  Fix url_launcher for iOS <10 (flutter#407)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[image_picker]ImageSource.camera doesn't ask camera permission
5 participants