Skip to main content

Decode URL

LikeMinds React Native Chat SDK allows you to conveniently decode a URL string, providing the original URL components such as protocol, host, path, and query parameters for further processing or display.

Steps to decode URL

  1. Create a DecodeUrlRequest object using DecodeUrlRequestBuilder class by passing all the required parameters.
  2. For decoding an URL call decodeUrl() present in LMChatClient.
  3. Process the response DecodeUrlResponse as per your requirement.
const payload: any = {
url: "", // Text string representing url to be decoded
};
const response = await lmChatClient?.decodeUrl(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

DecodeUrlRequest

List of parameters provided by decodeUrl()

VariableTypeDescriptionOptional
urlstringURL of the link to be decoded

DecodeUrlResponse

List of parameters in the response.

VariableTypeDescription
ogTagsLinkOGTagsOG tags to show link preview