or manually add dependency to the pubspec.yaml
Import the YMChat library in your dart file.
This is the first and compulsary step.
ymAuthenticationToken is used to associate an identity of the user with the chat bot.
Whenever chatbot is launched with ymAuthenticationToken it will load the previous chats associated with this user since inception.
Note: History will load only when
Show history flag is enabled in the channel settings
ymchat_flutter supports firebase notifications. Pass your
FCM token in setDeviceToken method.
Note: Firebase service account key is required to send notifications. You can share the service account key with us. More info here
Additional information can be passed in the form of key value pair from app to bot using payload.
Payload can be used to pass information from host app to bot. The payload dictionary should be JSON compatible else an error will be thrown
For passing data from bot to app refer bot Bot Events
Payload is securely passed in HTTPS post request to protect the information passed in it
ymchat_flutter supports bots with on-prem deployments. For the bot to work, pass the on-prem URL to
You can enable V2 bot by calling
setVersion() method. Default value is 1
Speech to text can be enabled and disabled by calling setEnableSpeech(). Default value is
If you are supporting Speech recognition, add following snippet to Info.plist of the host app
Info.plist is found at path
Chat bot can be presented by calling
startChatbot(). This method will display full screen chat view
Bot events are used to pass information from bot to app. For passing events from app to bot refer Payload
Bot close event is separetly sent and it can be handled in following way.
Bot can be programmatically closed using
If you want to stop receiving push notifications you can unlink the device token. Device token typically is unlinked when the user logs out of the app.
A demo app can be used as a reference to better understand how this SDK can be integrated in the app https://github.com/yellowmessenger/ymchat-flutter-demo