Customize Text Strings and Settings values

Learn about text string customizations in Brand Messenger on Android

Text Strings

The SDK includes the following default strings. To override any of these defaults, create a string file called strings.xml in your res folder:

<resources>
   <string name="BrandMessenger_activityConversation">Messages</string>
   <string name="BrandMessenger_startOfConversation">This is the start of your conversation with the %1$s team. We\'ll stay in touch to help you get the most out of your app.</string>
   <string name="BrandMessenger_welcome">Feel free to leave us a message about anything that\'s on your mind. We\'ll get back to your questions, suggestion or anything else as soon as we can.</string>
   <string name="BrandMessenger_messageHint">Type a message&#8230;</string>
   <string name="BrandMessenger_btnSend">Send</string>
   <string name="BrandMessenger_chooseOption">Choose an Option</string>
   <string name="BrandMessenger_btnMenu">Choose an Option</string>
   <string name="BrandMessenger_takePhoto">Take a Quick Photo</string>
   <string name="BrandMessenger_chooseFromLibrary">Choose from Photo Gallery</string>
   <string name="BrandMessenger_chooseFile">Upload a File</string>
   <string name="BrandMessenger_shareLocation">Share Location</string>
   <string name="BrandMessenger_sendPhoto">Send Photo</string>
   <string name="BrandMessenger_send">Send</string>
   <string name="BrandMessenger_sendingMessage">Sending…</string>
   <string name="BrandMessenger_errorSendingMessage">Message not delivered. Tap to retry.</string>
   <string name="BrandMessenger_errorCouldNotConnect">Could not connect to server.</string>
   <string name="BrandMessenger_errorUserOffline">No Internet connection.</string>
   <string name="BrandMessenger_errorFileTooLarge">Max file size limit exceeded (%1$s).</string>
   <string name="BrandMessenger_errorVirusDetected">A virus was detected in your file and it has been rejected.</string>
   <string name="BrandMessenger_errorPostback">An error occurred while processing your action. Please try again.</string>
   <string name="BrandMessenger_errorFileTypeRejected">Unsupported file type.</string>
   <string name="BrandMessenger_errorDisplayImage">Error: Can\'t display image</string>
   <string name="BrandMessenger_conversationLoadingText">Loading conversation…</string>
   <string name="BrandMessenger_creditMessage">Enter your credit card to send %1$s securely to %2$s.</string>
   <string name="BrandMessenger_savedCreditMessage">You\'re about to send %1$s securely to %2$s.</string>
   <string name="BrandMessenger_creditErrorMessage">An error occurred while processing the card. Try again or use a different card.</string>
   <string name="BrandMessenger_btnPayNow">Pay Now</string>
   <string name="BrandMessenger_btnPaymentCompleted">Payment Completed</string>
   <string name="BrandMessenger_btnChangeCard">Change Credit Card</string>
   <string name="BrandMessenger_imageUploadRetry">Tap to reload image.</string>
   <string name="BrandMessenger_imageUploadPreviewNotAvailable">Preview not available.</string>
   <string name="BrandMessenger_imageUploadTapToView">Tap to view%1$s image.</string>
   <string name="BrandMessenger_problemGettingPhoto">There was a problem retrieving your photo.</string>
   <string name="BrandMessenger_problemSavingPhoto">There was a problem saving your photo.</string>
   <string name="BrandMessenger_problemLaunchingCamera">There was a problem launching the camera.</string>
   <string name="BrandMessenger_unsupportedMessageType">Unsupported message type</string>
   <string name="BrandMessenger_unsupportedActionType">Unsupported action type</string>
   <string name="BrandMessenger_locationSendingFailed">Could not send location.</string>
   <string name="BrandMessenger_locationRetrieveFailed">Could not retrieve location.</string>
   <string name="BrandMessenger_locationServicesDenied">Access to location services was denied. To enable, go to this app\'s settings and grant \"Location\" access.</string>
   <string name="BrandMessenger_locationServicesDeniedTitle">Location Services Denied</string>
   <string name="BrandMessenger_openSettings">Open Settings</string>
   <string name="BrandMessenger_webviewLoading">Loading…</string>
   <string name="BrandMessenger_relativeTimeJustNow">Just now</string>
   <string name="BrandMessenger_relativeTimeMinute">%dm ago</string>
   <string name="BrandMessenger_relativeTimeHour">%dh ago</string>
   <string name="BrandMessenger_relativeTimeDay">%dd ago</string>
   <string name="BrandMessenger_messageStatusDelivered">Delivered</string>
   <string name="BrandMessenger_messageStatusSeen">Seen</string>
   <string name="BrandMessenger_retrievingFile">Retrieving your file…</string>
   <string name="BrandMessenger_notificationFallbackText">Sent a message</string>
   <plurals name="BrandMessenger_unreadMessagesText">
       <item quantity="one">%d unread message</item>
       <item quantity="other">%d unread messages</item>
   </plurals>
</resources>

Settings Values

The SDK also includes a settings.xml file which can overwrite values to change the app behavior.
To override any of these defaults, create a string filed called settings.xml in your res folder:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <integer name="BrandMessenger_settings_hoursBetweenTimestamps">6</integer>
    <integer name="BrandMessenger_settings_inputMaxLines">5</integer>
    <integer name="BrandMessenger_settings_notificationId">1</integer>
    <string name="BrandMessenger_settings_conversationIdKey" translatable="false">conversationId</string>
    <string name="BrandMessenger_settings_notificationTriggerKey" translatable="false">trigger</string>
    <string name="BrandMessenger_settings_notificationTrigger" translatable="false">BrandMessengerNotification</string>
    <string name="BrandMessenger_settings_notificationTag">BrandMessenger</string>
    <string name="BrandMessenger_settings_timestampFormat">MMMM d, h:mm a</string>
    <string name="BrandMessenger_settings_shortTimestampFormat" translatable="false">h:mm a</string>
    <string name="BrandMessenger_settings_beforeNotificationIntent">com.khoros.messaging.ui.NotificationActivity</string>
    <string name="BrandMessenger_settings_notificationIntent">com.khoros.messaging.ui.ConversationActivity</string>
    <string name="BrandMessenger_settings_fileProvider" translatable="false">BRANDMESSENGER_FILE_PROVIDER</string>
    <string name="BrandMessenger_settings_notificationChannelId" translatable="false">com.khoros.messaging.notification</string>
    <string name="BrandMessenger_settings_notificationChannelName" translatable="true">Messages</string>
    <string name="BrandMessenger_settings_takePhotoMenuKey" translatable="false">takePhoto</string>
    <string name="BrandMessenger_settings_chooseMediaMenuKey" translatable="false">chooseMedia</string>
    <string name="BrandMessenger_settings_uploadFileMenuKey" translatable="false">uploadFile</string>
    <string name="BrandMessenger_settings_shareLocationMenuKey" translatable="false">shareLocation</string>
    <string-array name="BrandMessenger_settings_showMenuOptions" type="array">
        <item>@string/BrandMessenger_settings_takePhotoMenuKey</item>
        <item>@string/BrandMessenger_settings_chooseMediaMenuKey</item>
        <item>@string/BrandMessenger_settings_uploadFileMenuKey</item>
        <item>@string/BrandMessenger_settings_shareLocationMenuKey</item>
    </string-array>
    <item name="BrandMessenger_lineSpacingMultiplier" format="float" type="dimen">1.25</item>

    <bool name="BrandMessenger_night_mode_enabled">false</bool>
</resources>

Notification Action Intent

When a push notification is tapped, default behavior opens ConversationActivity. To override this, override BrandMessenger_settings_notificationIntent, BrandMessenger_settings_notificationTriggerKey and BrandMessenger_settings_notificationTrigger.
Inside the sdk, the activity intent is built as such:

String notificationIntentString = context.getString(R.string.BrandMessenger_settings_notificationIntent);
Class<?> intentToLaunch = Class.forName(intentString); // falls back to default if this throws.
Intent intent = new Intent(context, intentToLaunch);
intent.putExtra(
    context.getString(R.string.BrandMessenger_settings_notificationTriggerKey),
    context.getString(R.string.BrandMessenger_settings_notificationTrigger)
);

Notification Channel Settings

Apps targeting Android Oreo or higher will create and push notifications to a notification channel. The default channel settings can be overwritten with BrandMessenger_settings_notificationChannelId and BrandMessenger_settings_notificationChannelName.


Did this page help you?