OneBusAway / onebusaway-android

The official Android app for OneBusAway
http://www.onebusaway.org/
Other
472 stars 292 forks source link

Add support for situation (service alert) URL field #710

Closed barbeau closed 7 years ago

barbeau commented 7 years ago

Summary:

There is an undocumented URL field in situation elements (server docs issue at https://github.com/OneBusAway/onebusaway-application-modules/issues/187).

For example, see http://buseta.wmata.com/onebusaway-api-webapp/api/where/arrivals-and-departures-for-stop/1_18090.json?minutesAfter=65&app_ver=71&key=v1_BktoDJ2gJlu6nLM6LsT9H8IUbWc%3DcGF1bGN3YXR0c0BnbWFpbC5jb20%3D.

situations: [
{
activeWindows: [ ],
allAffects: [],
consequences: [
{
condition: "significant_delays",
conditionDetails: null
}
],
creationTime: 1472224980000,
description: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
id: "1_261B7F0A8A68F37591996B11D5C5CED3",
publicationWindows: [ ],
reason: "UNKNOWN_CAUSE",
severity: "unknown",
summary: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
url: null // <-- This will include a URL with more details, if the agency populates that field
},

Steps to reproduce:

Tap on a service alert that has the URL field populated

Expected behavior:

Show the URL and allow users to tap on it to be directed to the browser for more details

Observed behavior:

We don't currently surface situation URLs anywhere

Device and Android version:

N/A

barbeau commented 7 years ago

Here's the populated URL field:

...
summary: {
lang: "en",
value: "Impacts of SafeTrack Surge #9 on Metrobus Customers"
},
url: {
lang: "en",
value: "http://www.wmata.com/rider_tools/metro_service_status/advisories.cfm?AID=5749"
}
...
barbeau commented 7 years ago

Working on this...