Loading

Custom Parameters are taking up the API Name instead of Label Name in Messaging for In-App (iOS)

Дата публикации: Jul 7, 2025
Решение

Create a mapping for the languages and locals from the device to match the Salesforce language codes. 

Here is the example from the Release Notes (v1.6.1): 

This dictionary when provided to the remoteLocaleMap parameter of the UIConfiguration initializer will result in remote 
config service responses being translated in the following ways.


 1. If the device locale is setup for English Canada the fetched language will be English
 2. If the device locale is setup for French France the fetched language will be French
 3. All other locales will result in German.


 The default key is optional, and if not provided the device locale will be used, and if not supported by salesforce will not result
 in properly translated strings.

The default parameter is optional and if omitted will just fallback to using the device locale
let localeMap = ["en-ca": "en",
                 "fr-fr": "fr",
                 "default": "de"]

let myConfig = UIConfiguration(serviceAPI: "<Your Service API URL>",
                               organizationId: "<Your Organization Id>",
                               developerName: "<Your Developer Name>",
                               remoteLocaleMap: localeMap,
                               conversationId: "<Your Conversation Id>")



Check the locale that is being sent from the device:

let langStr = Locale.current.languageCode



Then create a map to the Salesforce support languages.

English canada is show in the example, but in Spain for example the SDK may be sending the language code es-ES, with the Spanish for the locale of Spain. Salesforce does not know what this is. The Salesforce org only understands es. So the customer will need to create a map:

let localeMap = ["es-ES": "es",
                 "default": "es"]



Номер статьи базы знаний

003876263

 
Загрузка
Salesforce Help | Article