I am facing an issue with my Xamarin Forms app where JavaScript is being called and a JSON string containing a path is sent as a parameter. The problem arises when the backslashes get double-escaped in C#, but only single backslashes remain when it reaches the JavaScript function, causing the JSON parsing to fail.
"myreturnfunc('', '{\"statusCode\":\"200\",\"path\":\"\\\\temp\\\\Uploads\\\\100650\\\\IMG_20200107_094705_5.jpg\"}');"
My question is, how can I ensure that the escaped backslashes are correctly retained? Interestingly, when the method is called from another JavaScript function, the format remains intact:
{"path":"\\temp\\Uploads\\100650\\IMG_20200107_094705_5.jpg","statusCode":"200"}