mapbox / mapbox-events-ios

Mapbox Events Framework for iOS
Other
20 stars 38 forks source link

🐞 [iOS] app is killed with signal 9 when put in background #336

Closed noway closed 2 years ago

noway commented 2 years ago

Configuration

Steps to Reproduce I'm using react-native-mapbox-gl and trying to play audio in background. The map is shown when the audio starts playing.

  1. Start playing audio
  2. Lock the phone
  3. Wait about a minute or so
  4. App is killed with "Message from debugger: Terminated due to signal 9" message.

I have both location and audio UIBackgroundModes yet it still happens.

image

I suspect the app is killed because of the background task that MapboxMobileEvents creates. See the logs bellow.

Expected

  1. The app not to be killed by OS

Logging 2022-03-24 11:54:31.101062+1300 myapp[8916:3189929] [BackgroundTask] Background Task 27 ("Called by MapboxMobileEvents, from -[MMEUIApplicationWrapper beginBackgroundTaskWithExpirationHandler:]"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.

vayesh commented 2 years ago

@noway Could you specify the version of MapboxMobileEvents.xcframework you are using?

noway commented 2 years ago

@vesh93 I'm using version 0.10.13.

vayesh commented 2 years ago

@noway Thanks. There are no similar known issues for this version. I'll investigate it and get back to you.

vayesh commented 2 years ago

The issue is reproduced locally, looking for a fix.

vayesh commented 2 years ago

@noway The issue should be fixed in v1.0.8. Could you please validate the fix?