Loading

アプリ内のメッセージングから MEU の進行中の会話 ID を取得する

公開日: Jan 15, 2025
説明

>>CX がメッセージングセッションをモバイルで初めて開始するときに、以下のドキュメントに記載のとおり、uuid() を含むランダムの会話 ID を作成します。

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
>>顧客が Web にアクセスするときに、JWT トークンには MEU がサブジェクトとして含まれており、それを利用して進行中の会話や履歴も取得します。

詳細情報: https://help.salesforce.com/s/articleView?id=service.user_verification_overview.htm&type=5

MEU がまず Web で会話を開始し、その後モバイルに移動した場合、認証済みの MEU の進行中の会話を取得する方法はこちらのとおりです。

解決策

<<前提条件>>

>>Salesforce でのユーザー検証設定を完了する:
https://help.salesforce.com/s/articleView?id=service.user_verification_setup.htm&type=5
>>iOS/Android のアプリ内のメッセージングを構築する:
https://developer.salesforce.com/docs/service/messaging-in-app/guide/introduction.html

コアクライアントオブジェクトに代理を追加するときに、以下のコードを使って進行中の会話を取得する必要があります。
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

>>以下のドキュメントにあるように、強制フラグを使うと、リクエストがローカルデータベースだけでなく、ネットワークから行われていることを確認できます。

forceRefresh ドキュメント

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: True に設定すると、リクエストされたデータは強制的にネットワークで更新されます。True でない場合、リクエストされたデータはローカルキャッシュから取得され、ローカルで結果が見つからない場合のみネットワークで更新されます。デフォルト値は False です。

WEB のメッセージングの場合、会話を作成したり取得したりする必要はありません。JWT トークンには MEU のサブジェクトが含まれており、このトークンを使用することで MEU に関連する進行中の会話を自動的に取得することができるためです。

詳細情報: 
https://help.salesforce.com/s/articleView?id=service.user_verification_overview.htm&type=5

ナレッジ記事番号

004141327

 
読み込み中
Salesforce Help | Article