Image broken on iOS using RocketChat livechat api

I found that the cookies are not saving when the live chat is initialized on the mobile app (Android and iOS). This issue causes the image to be broken and the download feature to not work, most likely on iOS. When uploading the image, it successfully uploaded the file, but on iOS, it showed a broken image, while on Rocket Chat, the image is not broken.

On the portal, the cookies are set when the Rocket Chat live chat is initialized.

On Mobile app (iOS)

After uploading the file on the mobile the image is broken

Developer Inspect for iOS

After uploading the file this is the response from rocketchat to mobile app.

When the rocketchat livechat is initialized to the mobile app.

On the rocketchat ommichannel the image is not broken.

Versions of the tools and application used rocketchat.
mobile app - ionic 5
Rocketchat -
Screenshot 2023-05-03 at 4.57.18 PM
iOS version - 16.4
Android Version - 13

Anyone who knows the issue let me know if you have a workaround solution.