Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
bilalsaeed opened this issue Sep 26, 2023 · 4 comments
Open
3 tasks done

Comments

@bilalsaeed
Copy link

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@bilalsaeed
Copy link
Author

is it possible to just close the camera when app is minimize i.e., when platform is stopped?

@thiagoroc
Copy link

thiagoroc commented Sep 26, 2023

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

I used background-mode plugin for correct this problem no Android. I think it works on IOS too.

@bilalsaeed
Copy link
Author

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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

I used background-mode plugin for correct this problem no Android. I think it works on IOS too.

Could you please let me know how did background-mode plugin solve the problem?

Thanks,

@breautek
Copy link
Contributor

breautek commented Oct 4, 2023

Are you able to provide a back trace or a stack trace? If this information isn't available, then the best way to move this forward is to provide a bare reproduction app using nothing but the cordova camera plugin and anything else required to reproduce the crash. It should not contain any frameworks which helps isolate the issue down to just Apache Cordova code.

Also are you sure that your app simply isn't closing because it's in the background? OS reserves the right to close background apps for variety of reasons, a common one is to provide more resources to the foreground app. In this case, then the app is terminated (not crashed) and will be restarted when the user returns to the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants