DEV-ios icon indicating copy to clipboard operation
DEV-ios copied to clipboard

Switching out of the app, using the Camera app and switching back crashes DEV app

Open Zhao-Andy opened this issue 6 years ago • 2 comments

Describe the bug This is reported by someone via email; details are as-is.

I was writing reply a thread. I press home button and I opened the camera app then I took a photo. After returning back to the app, all I've written in uitextfield was gone. In fact app restarted itself. But If I go home screen from the app without doing anyting there, then returning back to the app, there is no problem.

To Reproduce Steps to reproduce the behavior:

  1. Open the DEV app
  2. Go to an article
  3. Type a comment in the comment text field
  4. Go to the home screen
  5. Open the camera app
  6. Take a photo
  7. Switch back to DEV app
  8. Text field is erased and DEV app restarts

Expected behavior Ensure that leaving text in the comment field and doing the following will not wipe the text field nor restart the app:

  • navigating to the home screen and back
  • navigating to the home screen, opening the camera app (or any other app) and back
  • navigating to the home screen, doing something in a different app (take a photo, send a text, etc) and back

Smartphone (please complete the following information):

  • Device: iPhone 8
  • OS: 11.4.1

Zhao-Andy avatar Nov 14 '18 17:11 Zhao-Andy

I haven't been able to reproduce this.

benhalpern avatar Nov 28 '18 15:11 benhalpern

I haven't been able to reproduce this either, but what I suspect is happening is that iOS is purging the app to free enough memory for the task the user is currently doing (in this case using the camera). Hence the app restarting itself when the user switched back to DEV.

To solve this we need to save the state in one of the AppDelegate functions.

chickdan avatar Nov 28 '18 17:11 chickdan