Implement stop() to close CAMERA or PHOTOLIBRARY#873
Implement stop() to close CAMERA or PHOTOLIBRARY#873NityaSantosh26 wants to merge 3 commits intoapache:masterfrom
Conversation
|
This PR doesn't compile on android: Additionally there are lint issues present in this PR: |
|
@breautek, My bad. I had an incomplete commit. Let me update my commit. |
|
Hey @breautek , Can I expect this PR also to be part of v8? |
Sorry I was pre-occupied with more important changes that needed to make it's way through in v8 and I don't want to delay the release any further due to Android's October 31st deadline (the voting process takes minimum 48 hours so it is already behind) so I'll be beginning the vote process without this feature. I bumped the milestone so that we can take a look for maybe an 8.1 release. |
breautek
left a comment
There was a problem hiding this comment.
Our browser implementation for the camera I would say is barely usable but to make this feature complete, it would be nice to also have a browser implementation to hide the form input or whatever what the browser implementation does to show the camera/dialog.
| callbackContext.sendPluginResult(r); | ||
|
|
||
| return true; | ||
| } if (action.equals("stop")) { |
There was a problem hiding this comment.
I believe this is intended to be an else if
Platforms affected
Android and iOS
Motivation and Context
I have an usecase where user opens camera and if there's an high priority push notification is received, when user clicks, it doesn't close the camera, User has to manually close the camera. Now using the navigator.camera.stop(). I can achieve this behavior.
And there are other instances which needs closing of camera or photo library from the code.
Description
Added a new method stop() which handles the closing of CAMERA or PHOTOLIBRARY for both Android and iOS.
Testing
I have verified the usecase I have mentioned above, when a push notification is clicked that closes the camera and takes to the destination page in the module by calling the stop() method.
Checklist
(platform)if this change only applies to one platform (e.g.(android))