{"action":"created","issue":{"url":"https://api.github.com/repos/xamarin/Caboodle/issues/7","repository_url":"https://api.github.com/repos/xamarin/Caboodle","labels_url":"https://api.github.com/repos/xamarin/Caboodle/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/xamarin/Caboodle/issues/7/comments","events_url":"https://api.github.com/repos/xamarin/Caboodle/issues/7/events","html_url":"https://github.com/xamarin/Caboodle/issues/7","id":299901012,"number":7,"title":"Geolocation API's","user":{"login":"Redth","id":271950,"avatar_url":"https://avatars1.githubusercontent.com/u/271950?v=4","gravatar_id":"","url":"https://api.github.com/users/Redth","html_url":"https://github.com/Redth","followers_url":"https://api.github.com/users/Redth/followers","following_url":"https://api.github.com/users/Redth/following{/other_user}","gists_url":"https://api.github.com/users/Redth/gists{/gist_id}","starred_url":"https://api.github.com/users/Redth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redth/subscriptions","organizations_url":"https://api.github.com/users/Redth/orgs","repos_url":"https://api.github.com/users/Redth/repos","events_url":"https://api.github.com/users/Redth/events{/privacy}","received_events_url":"https://api.github.com/users/Redth/received_events","type":"User","site_admin":false},"labels":[{"id":842976903,"url":"https://api.github.com/repos/xamarin/Caboodle/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"open","locked":false,"assignee":{"login":"Redth","id":271950,"avatar_url":"https://avatars1.githubusercontent.com/u/271950?v=4","gravatar_id":"","url":"https://api.github.com/users/Redth","html_url":"https://github.com/Redth","followers_url":"https://api.github.com/users/Redth/followers","following_url":"https://api.github.com/users/Redth/following{/other_user}","gists_url":"https://api.github.com/users/Redth/gists{/gist_id}","starred_url":"https://api.github.com/users/Redth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redth/subscriptions","organizations_url":"https://api.github.com/users/Redth/orgs","repos_url":"https://api.github.com/users/Redth/repos","events_url":"https://api.github.com/users/Redth/events{/privacy}","received_events_url":"https://api.github.com/users/Redth/received_events","type":"User","site_admin":false},"assignees":[{"login":"Redth","id":271950,"avatar_url":"https://avatars1.githubusercontent.com/u/271950?v=4","gravatar_id":"","url":"https://api.github.com/users/Redth","html_url":"https://github.com/Redth","followers_url":"https://api.github.com/users/Redth/followers","following_url":"https://api.github.com/users/Redth/following{/other_user}","gists_url":"https://api.github.com/users/Redth/gists{/gist_id}","starred_url":"https://api.github.com/users/Redth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redth/subscriptions","organizations_url":"https://api.github.com/users/Redth/orgs","repos_url":"https://api.github.com/users/Redth/repos","events_url":"https://api.github.com/users/Redth/events{/privacy}","received_events_url":"https://api.github.com/users/Redth/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/xamarin/Caboodle/milestones/1","html_url":"https://github.com/xamarin/Caboodle/milestone/1","labels_url":"https://api.github.com/repos/xamarin/Caboodle/milestones/1/labels","id":3140424,"number":1,"title":"Preview-1","description":null,"creator":{"login":"Redth","id":271950,"avatar_url":"https://avatars1.githubusercontent.com/u/271950?v=4","gravatar_id":"","url":"https://api.github.com/users/Redth","html_url":"https://github.com/Redth","followers_url":"https://api.github.com/users/Redth/followers","following_url":"https://api.github.com/users/Redth/following{/other_user}","gists_url":"https://api.github.com/users/Redth/gists{/gist_id}","starred_url":"https://api.github.com/users/Redth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Redth/subscriptions","organizations_url":"https://api.github.com/users/Redth/orgs","repos_url":"https://api.github.com/users/Redth/repos","events_url":"https://api.github.com/users/Redth/events{/privacy}","received_events_url":"https://api.github.com/users/Redth/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":1,"state":"open","created_at":"2018-02-24T01:42:36Z","updated_at":"2018-02-25T17:25:03Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-02-24T02:01:29Z","updated_at":"2018-02-25T17:44:37Z","closed_at":null,"author_association":"MEMBER","body":"The Geolocation API is meant to be extremely simple at this point.  Finding the last location, \r\n\r\n```csharp\r\nstatic class Geolocation {\r\n    // Android and iOS have a concept of a last known position that should return very quickly compared to firing up the GPS and waiting for a position.\r\n    // This should return null if there is no known last position.\r\n    // UWP has something interesting about consent-less location:\r\n    // https://docs.microsoft.com/en-us/uwp/api/Windows.Devices.Geolocation.Geolocator#Windows_Devices_Geolocation_Geolocator_AllowFallbackToConsentlessPositions\r\n    static Task<Position> GetLastKnownPositionAsync();\r\n\r\n    // We should throw different exceptions depending on the error: For example a DeviceFeatureUnavailableException or something similar if the device has no GPS abilities.\r\n    static Task<Position> GetPositionAsync(GeolocationAccuracy desiredAccuracy, TimeSpan timeout, CancellationToken token = default(CancellationToken));\r\n}\r\n```\r\n\r\n```csharp\r\nenum GeolocationAccuracy {\r\n    Lowest,\r\n    Low,\r\n    Medium,\r\n    High,\r\n    Best\r\n}\r\n```\r\n\r\nThe accuracy enum values should map to the following table of platform specific accuracy choices:\r\n\r\n|            | **iOS**          | Expected | **Android**                   | Expected | **UWP** | Expected  |\r\n| ---------- | ---------------- | -------- | ----------------------------- | -------- | ------- | --------- |\r\n| **Lowest** | ThreeKilometers  | 3000     | ACCURACY_LOW, POWER_LOW       | 500      | 3000    | 1000-5000 |\r\n| **Low**    | Kilometer        | 1000     | ACCURACY_LOW, POWER_MEDIUM    | 500      | 1000    | 300-3000  |\r\n| **Medium** | HundredMeters    | 100      | ACCURACY_MEDIUM, POWER_MEDIUM | 100-500  | 100     | 30-500    |\r\n| **High**   | NearestTenMeters | 10       | ACCURACY_HIGH, POWER_MEDIUM   | 0-100    | High    | <=10      |\r\n| **Best**   | Best             | 0        | ACCURACY_HIGH, POWER_HIGH     | 0-100    | High    | <=10      |\r\n\r\n```csharp\r\nstatic class Geocoding {\r\n    // Requires a map key string on UWP\r\n    // should throw an exception on UWP if this isn’t specified via the static MapKey property.\r\n    static Task<IEnumerable<Address>> GetAddressesAsync(Position position);\r\n}\r\n\r\n// UWP-only partial\r\nstatic class Geocoding {\r\n    // UWP Only, and should only be in the UWP assembly\r\n    // Users can call `Geolocation.MapKey = \"blah\"` from their UWP specific code (like where Inits are called).\r\n    static string MapKey { get; set; }\r\n}\r\n```\r\n\r\n```csharp\r\nclass Position {\r\n    Position();\r\n    Position(double latitude, double longitude);\r\n    Position(double latitude, double longitude, DateTimeOffset timestamp);\r\n    Position(Position position);\r\n\r\n    DateTimeOffset Timestamp { get; set; }\r\n    double Latitude { get; set; }\r\n    double Longitude { get; set; }\r\n\r\n    static double ConvertKmToMiles(double kilometers);\r\n    static double ConvertMilesToKm(double miles);\r\n\r\n    static double CalculateDistance(Position positionStart, Position positionEnd, DistanceUnits units);\r\n    static double CalculateDistance(double latitudeStart, double longitudeStart, double latitudeEnd, double longitudeEnd);\r\n}\r\n```\r\n\r\n```csharp\r\nclass Address {\r\n    double Latitude{ get; set; }\r\n    double Longitude{ get; set; }\r\n\r\n    string CountryCode { get; set; }\r\n    string CountryName { get; set; }\r\n    string FeatureName { get; set; }\r\n    string PostalCode { get; set; }\r\n    string SubLocality { get; set; }\r\n    string Thoroughfare { get; set; }\r\n    string SubThoroughfare { get; set; }\r\n    string Locality { get; set; }\r\n    string AdminArea { get; set; }\r\n    string SubAdminArea { get; set; }\r\n}\r\n```\r\n```csharp\r\nclass GeolocationException {\r\n    GeolocationException(GeolocationErrorType errorType);\r\n    GeolocationException(GeolocationErrorType, Exception innerException);\r\n\r\n    GeolocationErrorType ErrorType { get; }\r\n}\r\n```\r\n\r\n```csharp\r\nenum GeolocationErrorType {\r\n    PositionUnavailable,\r\n    Unauthorized\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/xamarin/Caboodle/issues/comments/368328680","html_url":"https://github.com/xamarin/Caboodle/issues/7#issuecomment-368328680","issue_url":"https://api.github.com/repos/xamarin/Caboodle/issues/7","id":368328680,"user":{"login":"mattleibow","id":1096616,"avatar_url":"https://avatars0.githubusercontent.com/u/1096616?v=4","gravatar_id":"","url":"https://api.github.com/users/mattleibow","html_url":"https://github.com/mattleibow","followers_url":"https://api.github.com/users/mattleibow/followers","following_url":"https://api.github.com/users/mattleibow/following{/other_user}","gists_url":"https://api.github.com/users/mattleibow/gists{/gist_id}","starred_url":"https://api.github.com/users/mattleibow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattleibow/subscriptions","organizations_url":"https://api.github.com/users/mattleibow/orgs","repos_url":"https://api.github.com/users/mattleibow/repos","events_url":"https://api.github.com/users/mattleibow/events{/privacy}","received_events_url":"https://api.github.com/users/mattleibow/received_events","type":"User","site_admin":false},"created_at":"2018-02-25T17:44:37Z","updated_at":"2018-02-25T17:44:37Z","author_association":"NONE","body":"Ah, just noticed that they both use the same `Position` type. Maybe this should stay together just so that there are no duplicates?"}}
{"actor":{"display_login":"mattleibow"}}