Once the Extension is enabled for your App and the settings are done, the recipients will receive metadata with the transcription details.The transcription information will be updated later for the message and hence you need to implement the onMessageEdited listener. Please check our Edit ,message documentation under the SDK of your choice.Here is a sample response:
Copy
Ask AI
"@injected": { "extensions": { "voice-transcription": { "transcribed_message": "This is a test" }}
If the voice-transcription key is missing, it means that either the extension is not enabled or has timed out.
At the recipients’ end, from the message object, you can fetch the metadata by calling the getMetadata() method. Using this metadata, you can fetch the Rich Media Embed.
Copy
Ask AI
var metadata = message.getMetadata();if (metadata != null) { var injectedObject = metadata["@injected"]; if (injectedObject != null && injectedObject.hasOwnProperty("extensions")) { var extensionsObject = injectedObject["extensions"]; if ( extensionsObject != null && extensionsObject.hasOwnProperty("voice-transcription") ) { var voiceTranscriptionObject = extensionsObject["voice-transcription"]; var transcribed_message = voiceTranscriptionObject["transcribed_message"]; } }}