[TIMOB-19028] Windows: Geolocation module should instantiate Geolocator on-demand when in UI thread
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-06-16T15:10:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Kota Iguchi |
Created | 2015-06-15T19:12:28.000+0000 |
Updated | 2017-03-16T21:53:20.000+0000 |
Description
Our current Windows Geolocation module generates a wrapped Geolocator in it's constructor. We should be generating it lazily on-demand, and hopefully in the UI thread according to the guidelines: https://msdn.microsoft.com/en-us/library/windows/apps/hh465148.aspx
bq. On Windows only, the first use of the Geolocator object must be made on the main UI thread, to show a consent prompt to the user. The first use of the Geolocator can be either the first call to getGeopositionAsync or the first registration of a handler for the positionChanged event. The consent prompt is described further in Guidelines for using sensitive devices. This means that in an app using JavaScript, the first use of the Geolocator object should not occur in an activation handler.
As noted, this isn't an issue for phone apps, but for "store" apps.
https://github.com/appcelerator/titanium_mobile_windows/pull/288
Closing ticket as the issue has been fixed.