mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Creating a MapSnapshot from the background

Open georgbachmann opened this issue 5 years ago • 1 comments

For my App I have a counterpart watch app. It would be great to show the user a map of where he is. As there is not native watchOS framework from what I have seen, it would be nice to make a snapshot of a map on the counterpart phone and send it as an image to the watch. That works well, as long as the phone is in foreground. As soon as the phone goes into background mode, the snapshot is not working any more.

Is this on purpose? And is there a way around that problem?

Steps to reproduce

  1. Make your app go into background (hit the home button)
  2. Try to make a map-snapshot. The completion block will never be called.

Expected behavior

Completion getting called with a proper map-snapshot

Actual behavior

Completion is not getting called

Configuration

Mapbox SDK versions: 6.0 iOS/macOS versions: iOS 13.6 Device/simulator models: iPhone X Xcode version: 11.6

georgbachmann avatar Aug 10 '20 06:08 georgbachmann

I'd like to see this too - with Widgets coming to iOS, creating snapshots in the background would be very useful. My guess is that because iOS doesn't allow OpenGL things to run in the background, Mapbox can't do its snapshot thing in the background either...

hactar avatar Aug 10 '20 07:08 hactar