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
- Create a
DecodeUrlRequestobject usingDecodeUrlRequestBuilderclass by passing all the required parameters. - For decoding an URL call
decodeUrl()present inLMChatClient. - Process the response
DecodeUrlResponseas per your requirement.
const payload: any = {
url: "ENTER_URL",
};
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()
| Variable | Type | Description | Optional |
|---|---|---|---|
url | string | URL of the link to be decoded |
DecodeUrlResponse
List of parameters in the response.
| Variable | Type | Description |
|---|---|---|
ogTags | LinkOGTags | OG tags to show link preview |