apache / apache/cordova-plugin-camera

Need a method stop() to close the Camera or PhotoLibrary from code.

Open
#874 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
976
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

# Feature Request

## Motivation Behind Feature

It's really helpful to have a control to close the resources like CAMERA or PHOTOLIBRARY.
**UseCases:**
- If resources are being used for more than limited time, we can close them automatically.
- Push Notifications, While Capturing if there's a notification, then we need to close the camera automatically from code rather than manually clicking on close button.

## Feature Description

It's just a new method which is supposed to close the CAMERA or PHOTOLIBRARY from code.
By calling this method, it closes the resources and resumes the app to it's initial state.

## Alternatives or Workarounds

For me, It's a blocking issue as it's supposed to close the CAMERA automatically but that's not the behavior with the plugin as there's no method available to close it.
So the implemenation of the stop() for both Android and iOS is needed.

I can contribute by implementing the stop() which closes the resources from javascript. By calling navigator.camera.stop() which works for both android and iOS.

Here's a PR that I have created. Please go through the implementation.
[https://github.com/apache/cordova-plugin-camera/pull/873](url)

Contributor guide

Open the contributing guide

Research direction

Review PR #873 first; no source files or tests are named in the issue. Compare the proposed navigator.camera.stop() behavior for Camera and PhotoLibrary on Android and iOS, and verify that calling it closes the resource and resumes the app to its initial state.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, javascript, objective-c
Domain
api, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.