Closed
Bug 872902
Opened 11 years ago
Closed 11 years ago
Fireplace should update region based on geolocation from API
Categories
(Marketplace Graveyard :: Consumer Pages, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
2013-05-23
People
(Reporter: cvan, Unassigned)
References
Details
(Whiteboard: [fireplace] p=)
With a SIM card ... ... it's easy. *Fireplace* looks at `navigator.mozMobileConnection.lastKnownNetwork` which returns the MCC/MNC pair and determine the region and carrier. Without a SIM card ... ... it's complicated. *Fireplace* defaults to the "Worldwide" region and no carrier, passing `?region=&carrier=` whenever we make a request to Zamboni's Marketplace API. Whenever we don't explicitly pass a `?region=`, the `RegionMiddleware` talks to `geodude` which looks at your IP to place the user into a region: https://github.com/mozilla/zamboni/blob/master/mkt/regions/middleware.py#L28 (Caveat worth noting: the Marketplace, as a packaged app, cannot determine the IP address on Firefox OS/Android because we're not and cannot be a certified app.) I'm open to more elegant solutions, but since Zamboni is the agent doing to the geolocation, Wraithan and I discussed that we could set on each API request a header containing contains the region that Zamboni placed the user in. Then whenever the first API request/pool finishes, Fireplace takes the region passed back in the header and modifies `user.settings.region` and the new Region shows up: http://f.cl.ly/items/3z3f1P0v1T0Q3G0z2T2o/Screen%20Shot%202013-05-15%20at%2010.15.58%20PM.png
Comment 1•11 years ago
|
||
We already do this: https://github.com/mozilla/fireplace/blob/master/hearth/media/js/requests.js#L95
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•