You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
is it supposed to work in iOS action extensions? #4734
Trying to incorporate Mapbox into an iOS action extension (as I haven't found any information of such tries on the Internet). Outcome: the view shows only mapbox logo, (i) button, and is completely blank. One error on the console: Failed to inherit CoreMedia permissions from 14090: (null), it seems to be appearing on a try to access non-AppGroup NSUserDefaults.
Any ideas? May I help with some logs given I could turn on some verbosity/debug logging?
We haven’t tested our SDK in app extensions and I would be somewhat surprised if you could get a map to draw with any of the extension flavors — memory limits are said to be quite low.
While it is a bug that MGLMapView’s map fails to appear in an action extension view, I don’t think fixing this problem would be worthwhile right now — the memory limits are too low.
For example, though a MapKit view in an action extension will load and be interactive, it will immediately receive memory warnings and be killed after a few seconds.
As an alternative to a live map, I’d suggest looking at MapboxStatic.swift, which you can use to load and display a static map image.
For posterity, here is what MGLMapView looks like when loaded in an action extension:
I'm using a Snapshot static map in a today extension and it's working well. I'm using an AppGroup UserDefaults to share some data with the main app. This was after running into the memory limits of an extension when trying to use a live map.
Noting that Apple explicitly calls out the GL maps use case as being problematic in extensions:
Note: Extensions have much lower per-process memory limit. Certain technologies, such as map views and SpriteKit, carry a high baseline memory cost and may be unsuitable for use in an extension.
Activity
friedbunny commentedon Apr 18, 2016
We haven’t tested our SDK in app extensions and I would be somewhat surprised if you could get a map to draw with any of the extension flavors — memory limits are said to be quite low.
friedbunny commentedon Apr 19, 2016
While it is a bug that MGLMapView’s map fails to appear in an action extension view, I don’t think fixing this problem would be worthwhile right now — the memory limits are too low.
For example, though a MapKit view in an action extension will load and be interactive, it will immediately receive memory warnings and be killed after a few seconds.
As an alternative to a live map, I’d suggest looking at MapboxStatic.swift, which you can use to load and display a static map image.
For posterity, here is what MGLMapView looks like when loaded in an action extension:
EPage-Ed commentedon Apr 21, 2017
I'm using a Snapshot static map in a today extension and it's working well. I'm using an AppGroup UserDefaults to share some data with the main app. This was after running into the memory limits of an extension when trying to use a live map.
friedbunny commentedon Jul 13, 2017
Noting that Apple explicitly calls out the GL maps use case as being problematic in extensions: