loadsmart / rn-salesforce-chat

React Native wrapper for Salesforce SDK chat
MIT License
7 stars 10 forks source link

How to hide modal chat? #33

Closed sendipatryjar closed 2 years ago

sendipatryjar commented 2 years ago

Describe the issue I want to force the user to logout and close the chat modal, how can I close the modal? is there a function that handles that?

Smartphone (please complete the following information):

rn-salesforce-chat version (please complete the following information):

Screenshots

gambar
lenoirzamboni commented 2 years ago

Hello @sendipatryjar. Right now, the Salesforce SDK does not offer this possibility. if someday this is available, we will definitely implement it.

Shahzad101digital commented 1 year ago

Add this method in RNSalesforceChatModule.java

@ReactMethod public void endSession(final Callback failureCallback, final Callback successCallback) { Runnable endChatRunnable = new Runnable() { @Override public void run() { if (_chatUIClient == null) { failureCallback.invoke("error - chat not active"); return; } _chatUIClient.endChatSession(); successCallback.invoke(); } }; reactContext.runOnUiQueueThread(endChatRunnable); }