diff --git a/platform/android/CHANGELOG.md b/platform/android/CHANGELOG.md index 6f824e764..9b1232d12 100644 --- a/platform/android/CHANGELOG.md +++ b/platform/android/CHANGELOG.md @@ -4,6 +4,8 @@ ### ✨ Features and improvements +- Update user agent from Mapbox to MapLibreNative. + ### 🐞 Bug fixes ## 11.0.0 diff --git a/platform/android/MapLibreAndroid/build.gradle b/platform/android/MapLibreAndroid/build.gradle index 6bad8ebc3..2e0482569 100644 --- a/platform/android/MapLibreAndroid/build.gradle +++ b/platform/android/MapLibreAndroid/build.gradle @@ -51,10 +51,7 @@ android { targetSdkVersion 33 buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision()) buildConfigField "String", "GIT_REVISION", String.format("\"%s\"", getGitRevision(false)) - buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android") - buildConfigField "String", "MAPBOX_SDK_VERSION", String.format("\"%s\"", project.VERSION_NAME) - buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME) - buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME) + buildConfigField "String", "MAPLIBRE_VERSION_STRING", String.format("\"MapLibre Native/%s\"", project.VERSION_NAME) consumerProguardFiles 'proguard-rules.pro' externalNativeBuild { diff --git a/platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java b/platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java index cf509def7..ab365e24e 100644 --- a/platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java +++ b/platform/android/MapLibreAndroid/src/main/java/org/maplibre/android/module/http/HttpRequestImpl.java @@ -41,7 +41,7 @@ public class HttpRequestImpl implements HttpRequest { private static final String userAgentString = toHumanReadableAscii( String.format("%s %s (%s) Android/%s (%s)", HttpIdentifier.getIdentifier(), - BuildConfig.MAPBOX_VERSION_STRING, + BuildConfig.MAPLIBRE_VERSION_STRING, BuildConfig.GIT_REVISION_SHORT, Build.VERSION.SDK_INT, Build.CPU_ABI) diff --git a/platform/darwin/src/http_file_source.mm b/platform/darwin/src/http_file_source.mm index 801962121..91273896a 100644 --- a/platform/darwin/src/http_file_source.mm +++ b/platform/darwin/src/http_file_source.mm @@ -158,7 +158,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const { // Avoid %s here because it inserts hidden bidirectional markers on macOS when the system // language is set to a right-to-left language. - [userAgentComponents addObject:[NSString stringWithFormat:@"MapboxGL/0.0.0 (%@)", + [userAgentComponents addObject:[NSString stringWithFormat:@"MapLibreNative/0.0.0 (%@)", @(mbgl::version::revision)]]; NSString *systemName = @"Darwin"; diff --git a/platform/default/src/mbgl/storage/http_file_source.cpp b/platform/default/src/mbgl/storage/http_file_source.cpp index 841e525cf..0b0d191c2 100644 --- a/platform/default/src/mbgl/storage/http_file_source.cpp +++ b/platform/default/src/mbgl/storage/http_file_source.cpp @@ -297,7 +297,7 @@ HTTPRequest::HTTPRequest(HTTPFileSource::Impl *context_, Resource resource_, Fil #else handleError(curl_easy_setopt(handle, CURLOPT_ENCODING, "gzip, deflate")); #endif - handleError(curl_easy_setopt(handle, CURLOPT_USERAGENT, "MapboxGL/1.0")); + handleError(curl_easy_setopt(handle, CURLOPT_USERAGENT, "MapLibreNative/1.0")); handleError(curl_easy_setopt(handle, CURLOPT_SHARE, context->share)); // Start requesting the information. diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 76b3a9364..897c21aaf 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,8 @@ MapLibre welcomes participation and contributions from everyone. Please read [`C ## main +- Update user agent from Mapbox to MapLibreNative. + ## 6.4.0 - User-Agent in network requests can now be changed via `MLNNativeNetworkManager.sharedManager.sessionConfiguration` ([#2293](https://github.com/maplibre/maplibre-native/pull/2293)).