[ios] Fix version in action sheet (#2602)

This commit is contained in:
Bart Louwers
2024-07-11 23:54:56 +02:00
committed by GitHub
parent 7b5e91fd00
commit 098cce9d39
25 changed files with 25 additions and 45 deletions

View File

@@ -8,6 +8,3 @@ BUNDLE_ID_PREFIX = "com.firstnamelastname"
# Enter your API key for MapTiler here, if you have one.
API_KEY = "0000000000"
# Semantic version number to include in plist files.
SEM_VER = "0.0.0"

View File

@@ -146,10 +146,7 @@ NSString *HTTPFileSource::Impl::getUserAgent() const {
NSBundle *sdkBundle = HTTPFileSource::Impl::getSDKBundle();
if (sdkBundle) {
NSString *versionString = sdkBundle.infoDictionary[@"MLNSemanticVersionString"];
if (!versionString) {
versionString = sdkBundle.infoDictionary[@"CFBundleShortVersionString"];
}
NSString *versionString = sdkBundle.infoDictionary[@"CFBundleShortVersionString"];
if (versionString) {
[userAgentComponents addObject:[NSString stringWithFormat:@"%@/%@",
sdkBundle.infoDictionary[@"CFBundleName"], versionString]];

View File

@@ -182,6 +182,11 @@ _IOS_APPLICATION_RESOURCES = [
"app/Assets.xcassets/**",
])
apple_bundle_version(
name = "maplibre_app_version",
build_version = "1.0.0",
)
ios_application(
name = "App",
bundle_id = "{}.maplibre.app".format(BUNDLE_ID_PREFIX),
@@ -193,6 +198,7 @@ ios_application(
minimum_os_version = "12.0",
provisioning_profile = "xcode_profile",
resources = _IOS_APPLICATION_RESOURCES,
version = ":maplibre_app_version",
visibility = ["//visibility:public"],
deps = [
"//platform:iosapp",

View File

@@ -16,8 +16,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleVersion</key>
<string>15256</string>
<key>LSRequiresIPhoneOS</key>

View File

@@ -14,8 +14,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleVersion</key>
<string>15256</string>
</dict>

View File

@@ -16,8 +16,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>

View File

@@ -1,4 +1,4 @@
load("@darwin_config//:config.bzl", "API_KEY", "SEM_VER")
load("@darwin_config//:config.bzl", "API_KEY")
def info_plist(name, base_info_plist, out, **kwargs):
native.genrule(
@@ -14,9 +14,7 @@ def info_plist(name, base_info_plist, out, **kwargs):
cp $(location {}) $@
plutil -replace MLNCommitHash -string $$(cat $(location //:git_hash)) $@
sem_version=\"""" + SEM_VER + """\"
token=\"""" + API_KEY + """\"
plutil -replace MLNSemanticVersionString -string $$sem_version $@
plutil -replace MLNApiKey -string $$token $@
""").format(base_info_plist),
**kwargs

View File

@@ -20,8 +20,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>

View File

@@ -10,16 +10,12 @@
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15256</string>
<key>MLNCommitHash</key>
<string>$(CURRENT_COMMIT_HASH)</string>
<key>MLNSemanticVersionString</key>
<string>$(CURRENT_SEMANTIC_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>

View File

@@ -14,16 +14,12 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15256</string>
<key>MLNCommitHash</key>
<string>$(CURRENT_COMMIT_HASH)</string>
<key>MLNSemanticVersionString</key>
<string>$(CURRENT_SEMANTIC_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>

View File

@@ -14,8 +14,6 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>5.9.0</string>
<key>CFBundleVersion</key>
<string>15256</string>
</dict>

View File

@@ -71,7 +71,7 @@
"ROAD_REF_A11Y_FMT" = "Route %@";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "The map failed to load because the style can’t be found or is incompatible.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "El mapa no s’ha carregat perquè s’ha corromput l’estil.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "El mapa no s’ha carregat perquè no es troba l’estil o bé és incompatible.";

View File

@@ -71,7 +71,7 @@
"ROAD_REF_A11Y_FMT" = "Route %@";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "The map failed to load because the style can’t be found or is incompatible.";

View File

@@ -77,7 +77,7 @@
"ROAD_REF_A11Y_FMT" = "Rute %@";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Kortet kunne ikke hentes fordi det enten ikke findes, eller ikke er kompatibelt.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "Die Karte konnte nicht geladen werden, da diese Form beschädigt ist.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Die Karte konnte nicht geladen werden, da diese Form nicht gefunden werden kann oder nicht kompatibel ist.";

View File

@@ -77,7 +77,7 @@
"ROAD_REF_A11Y_FMT" = "כביש %@";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "טעינת המפה נכשלה - לא ניתן למצוא את הסגנון או שהסגנון אינו תואם.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "Nem sikerült betölteni a térképet, mert a stílus sérült.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Nem sikerült betölteni a térképet, mert a stílus nem található vagy inkompatibilis.";

View File

@@ -41,7 +41,7 @@
"MAP_A11Y_VALUE" = "ズーム %1$d倍\n%2$ld ピン現れる";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* Telemetry prompt message */
"TELEMETRY_DISABLED_MSG" = "You can help make OpenStreetMap and Mapbox maps better by contributing anonymous usage data.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "Nepavyko užkrauti žemėlapio, nes stilius yra netinkamo formato.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Nepavyko užkrauti žemėlapio, nes neįmanoma rasti stiliaus arba jis nėra suderinamas.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "Falha ao carregar mapa porque o estilo está corrompido.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Falha ao carregar mapa porque o estilo não pode ser encontrado ou é incompatível.";

View File

@@ -77,7 +77,7 @@
"ROAD_REF_A11Y_FMT" = "Rutt %@";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "Kartan kunde inte laddas för att kartstilen kunde inte hittas eller för att den är inkompatibel.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "The map failed to load because the style is corrupted.";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "The map failed to load because the style can’t be found or is incompatible.";

View File

@@ -53,7 +53,7 @@
"PARSE_STYLE_FAILED_DESC" = "樣式表有毀損,無法載入地圖。";
/* Action sheet title */
"SDK_NAME" = "MapLibre Maps SDK for iOS";
"SDK_NAME" = "MapLibre Native iOS";
/* User-friendly error description */
"STYLE_NOT_FOUND_DESC" = "找不到樣式表或樣式表不兼容,無法載入地圖。";

View File

@@ -2864,14 +2864,14 @@ public:
}
}
NSString *actionSheetTitle = NSLocalizedStringWithDefaultValue(@"SDK_NAME", nil, nil, @"MapLibre Native for iOS", @"Action sheet title");
NSString *actionSheetTitle = NSLocalizedStringWithDefaultValue(@"SDK_NAME", nil, nil, @"MapLibre Native iOS", @"Action sheet title");
UIAlertController *attributionController = [UIAlertController alertControllerWithTitle:actionSheetTitle
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
if (shouldShowVersion)
NSString *version = [NSBundle mgl_frameworkInfoDictionary][@"CFBundleShortVersionString"];
if (shouldShowVersion && version != nil && ![version isEqualToString:@""])
{
attributionController.title = [actionSheetTitle stringByAppendingFormat:@" %@", [NSBundle mgl_frameworkInfoDictionary][@"MLNSemanticVersionString"]];
attributionController.title = [actionSheetTitle stringByAppendingFormat:@" %@", version];
}
NSArray *attributionInfos = [self.style attributionInfosWithFontSize:[UIFont buttonFontSize] linkColor:nil];