From f27563de27d28bcf22c8fcd321a4f963a483addb Mon Sep 17 00:00:00 2001 From: reveler-hub Date: Thu, 17 Sep 2026 17:41:11 +1200 Subject: [PATCH 1/3] Point Met Office's API key link to the right DataHub product Closes #1155. The link shown above the API key field pointed to Met Office's general public consumer site, not anywhere related to getting an API key - a user trying to sign up from that link would land on the wrong site entirely. Points to DataHub's Site Specific product page instead, which is the actual product this app's requests need (confirmed directly with the reporter - their key started working once subscribed to "Site Specific"). --- .../pranshulgg/weather_master_app/core/model/sources/Source.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt index 9205bf4e9..931057d6f 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt @@ -108,7 +108,7 @@ enum class Source( MET_OFFICE( displayName = "Met Office", fullName = "Meteorological Office", - displayLink = "https://www.metoffice.gov.uk/", + displayLink = "https://datahub.metoffice.gov.uk/pricing/site-specific", countryNameRes = R.string.country_united_kingdom, requiresUserApiKey = true, regionalButWorldwideSupport = true, From 2992fe5afbba932937fea706a729eb444944d7cf Mon Sep 17 00:00:00 2001 From: reveler-hub Date: Fri, 18 Sep 2026 10:51:46 +1200 Subject: [PATCH 2/3] Add a note on the API key screen for which Met Office product to subscribe to --- .../weather_master_app/core/model/sources/Source.kt | 2 ++ .../feature/apikeyconfig/ApiKeysConfigScreen.kt | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt index 931057d6f..8d39acc49 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt @@ -11,6 +11,7 @@ enum class Source( val fullName: String, val countryNameRes: Int? = null, val requiresUserApiKey: Boolean = false, // Source must not be selectable until the user has provided their API key + val apiKeyNote: String? = null, // Optional hint shown under the link on the API key entry screen val regionalButWorldwideSupport: Boolean = false, val capabilities: Set, // val providesAlerts: Boolean = false, @@ -111,6 +112,7 @@ enum class Source( displayLink = "https://datahub.metoffice.gov.uk/pricing/site-specific", countryNameRes = R.string.country_united_kingdom, requiresUserApiKey = true, + apiKeyNote = "Subscribe to the \"Global Spot\" option", regionalButWorldwideSupport = true, capabilities = setOf(Capability.WEATHER) ), diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt b/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt index 92b01d4d3..a11715e7a 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt @@ -54,7 +54,18 @@ fun ApiKeysConfigScreen(navController: NavController) { tiles = sourcesRequireApiKey.map { SettingTile.DialogTextFieldTile( - overline = { Text(it.displayLink) }, + overline = { + Column { + Text(it.displayLink) + it.apiKeyNote?.let { note -> + Text( + text = note, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + } + } + }, title = it.displayName, onTextSubmitted = { key -> viewModel.saveKey(key.trim(), it) From 991f74a9f650f71ebf105fea98f54cf270e33219 Mon Sep 17 00:00:00 2001 From: reveler-hub Date: Fri, 18 Sep 2026 19:31:29 +1200 Subject: [PATCH 3/3] Split Met Office's signup link from its general displayLink displayLink is also used for general 'about this source' info in WeatherSourcesScreen and the current-source info sheet, so overwriting it with the DataHub pricing page broke those. Adds a separate signupLink field used only on the API Keys screen instead, falling back to displayLink when unset. --- .../weather_master_app/core/model/sources/Source.kt | 4 +++- .../feature/apikeyconfig/ApiKeysConfigScreen.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt index 8d39acc49..60aee97b4 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/core/model/sources/Source.kt @@ -11,6 +11,7 @@ enum class Source( val fullName: String, val countryNameRes: Int? = null, val requiresUserApiKey: Boolean = false, // Source must not be selectable until the user has provided their API key + val signupLink: String? = null, // Shown instead of displayLink on the API key entry screen, when set val apiKeyNote: String? = null, // Optional hint shown under the link on the API key entry screen val regionalButWorldwideSupport: Boolean = false, val capabilities: Set, @@ -109,9 +110,10 @@ enum class Source( MET_OFFICE( displayName = "Met Office", fullName = "Meteorological Office", - displayLink = "https://datahub.metoffice.gov.uk/pricing/site-specific", + displayLink = "https://www.metoffice.gov.uk/", countryNameRes = R.string.country_united_kingdom, requiresUserApiKey = true, + signupLink = "https://datahub.metoffice.gov.uk/pricing/site-specific", apiKeyNote = "Subscribe to the \"Global Spot\" option", regionalButWorldwideSupport = true, capabilities = setOf(Capability.WEATHER) diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt b/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt index a11715e7a..0f854e033 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/feature/apikeyconfig/ApiKeysConfigScreen.kt @@ -56,7 +56,7 @@ fun ApiKeysConfigScreen(navController: NavController) { SettingTile.DialogTextFieldTile( overline = { Column { - Text(it.displayLink) + Text(it.signupLink ?: it.displayLink) it.apiKeyNote?.let { note -> Text( text = note,