apache / apache/cordova-plugin-camera

app crashes on iOS 16.x when app is minimized while camera is open

Open
#857 4 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

# Bug Report ionic app crashes on iOS 16.x when app is minimized while camera is open

## Problem
We are seeing weird problems in our ionic app for iOS. When we minimize the app while the camera was open, and open another app which accesses the camera our app crashes. We are only seeing this behaviour on iOS devices running 16.x+.

Our app crashes when we follow following steps:

1. Access camera in your cordova app
2. Minimize your app while the camera is open.
3. Open "Camera" app or any other app that accesses the camera and capture photo
4. Minimize the app you opened in 3rd step
5. Reopen your app and it crashes

### What is expected to happen?
When app minimizes it should close the camera,

### What does actually happen?
App crashes.

### Environment, Platform, Device

Tested on
iPhone 12 (16.6.1),
iPhone SE 2020 (16.1)

### Version information

Latest version of cordova ios and android.
camera plugin version: 6.0.0

## Checklist

- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash on the listed iOS 16.x devices using the five steps, then start by tracing the camera plugin's iOS lifecycle when the app is minimized and another camera app is used. Done means minimizing closes the camera and reopening the app no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.