Loading

Fetching MessagingEndUser’s Open ConversationID from Messaging IN-APP

Fecha de publicación: Jan 15, 2025
Descripción

>>We know that when the Customer initiates the messging session for the firsttime at mobile, we will be creating a random conversationId with uuid() as mentioned in the below doc

Android: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-ui-sdk.html
IOS: https://developer.salesforce.com/docs/service/messaging-in-app/guide/ios-ui-sdk.html
>>When customer comes to web, our JWT token has the subject as MessagingEndUser where it fetches the open conversation and fetches the history

Provided more info here: https://help.salesforce.com/s/articleView?id=service.user_verification_overview.htm&type=5

if the MessagingEndUser starts conversation first at Web and comes back to Mobile, here is the way to fetch open conversation of authorized MessagingEndUser

Solución

<<Prerequisites>>

>>Complete User Verification Setup in Salesforce :
https://help.salesforce.com/s/articleView?id=service.user_verification_setup.htm&type=5
>>Build IOS/ANDROID IN-APP messaging :
https://developer.salesforce.com/docs/service/messaging-in-app/guide/introduction.html

We need to fetch open conversation through below code while you implement Add your delegate to the core client object
Android: https://developer.salesforce.com/docs/service/messaging-in-app/guide/android-user-verification.html
IOS: https://developer.salesforce.com/docs/service/messaging-in-app/guide/ios-user-verification.html

>>We can use the force flag as documented to ensure the request is being made over the network and not just from the local database:

forceRefresh docs

Android:
https://salesforce-async-messaging.github.io/messaging-in-app-android/messaging-inapp-core/com.salesforce.android.smi.core/-core-client/index.html#1647340068%2FFunctions%2F415633242
IOS:
https://salesforce-async-messaging.github.io/messaging-in-app-ios/Protocols/SMICoreClient.html#/c:objc(pl)SMICoreClient(im)conversationsWithLimit:olderThanConversation:completion

 
abstract suspend fun conversations( limit: Int,
olderThanConversation: Conversation? = null,
conversationId: UUID? = null,
forceRefresh: Boolean = false
): Result<List<Conversation>>

 >>forceRefresh: Forces the requested data to be refreshed over the network when set to true. Otherwise, the requested data is fetched from the local cache and only refreshed over the network if no results are found locally. Default value is false.

For Messaging for WEB, we no need to create/fetch conversatio because JWT token has Sub of MessagingEndUser which automatically fetches open conversation of MessagingEndUser

Provided more info here: 
https://help.salesforce.com/s/articleView?id=service.user_verification_overview.htm&type=5

Número del artículo de conocimiento

004141327

 
Cargando
Salesforce Help | Article