taskrabbit / react-native-zendesk-chat

React Native Wrapper around Zendesk Chat v2
MIT License
130 stars 126 forks source link

How can I customize the initial message sent by the Answer Bot? #123

Open Guicbdiniz opened 2 years ago

Guicbdiniz commented 2 years ago

Hello. Is it possible to change the default message sent by the Answer Bot as the chat is opened?

knapeto commented 2 years ago

Hi,

yes you can! Here is the docs https://developer.zendesk.com/documentation/classic-sdks/unified-sdk/android/localize_text/#localizing-text

For android: android/app/src/main/res/values/chatbot.xml

<resources>
    <string name="zs_engine_greeting_message">.....</string>
</resources>

and for iOS: ios/Localizable.strings

"ios.conversation.ui.chat.welcome_message.conversation_start" = "....";
ahmedam55 commented 2 years ago

Thanks @knapeto for the help!

Do you know though how to change "Answer Bot" in iOS, as in Android they have a resource key for it, but not in iOS?

knapeto commented 2 years ago

I don't get your question. @ahmedam55

ahmedam55 commented 2 years ago

In Android, there is a key to change the string of "Answer Bot", for offline messages: https://developer.zendesk.com/documentation/classic-web-widget-sdks/unified-sdk/android/localize_text/#chat image

I don't seem to find such a key in iOS

knapeto commented 2 years ago

Answer Bot The Bot's name is set with a client-side API.

The Answer Bot component contains the following strings:


See docs here https://developer.zendesk.com/documentation/classic-web-widget-sdks/unified-sdk/ios/configure/#customize-the-bot-label-string

ahmedam55 commented 2 years ago

That's the Answer engine that suggests articles, not the offline messages one.

https://support.zendesk.com/hc/en-us/articles/4408823225370-Why-do-I-see-the-Answer-Bot-in-the-Chat-SDK-even-though-I-don-t-have-a-subscription-

knapeto commented 2 years ago

I see your point. Please ask on it in their support chat, they are good! Leave the answer here for the future. Thanks

ahmedam55 commented 2 years ago

That worked perfectly fine with me!

image

Ravid-anywhere commented 2 years ago

Hi! What file is it?

grifotv commented 2 years ago

@ahmedam55 @Ravid-anywhere as far as I know this can be set in JS via the startChat method:

ZendeskChat.startChat({
  messagingOptions: {
    botName: 'Custom Bot Name',
  },
});

Source: https://github.com/taskrabbit/react-native-zendesk-chat/blob/main/RNZendeskChat.d.ts#L8-L21

I can confirm botName field works. I haven't tried the iOS (botAvatarName + botAvatarName) nor the Android ones (botAvatarDrawableId). To be honest I'm not sure why botAvatarDrawableId would be of type number.