Ionic 4: json_decode() is not working

App is working just fine on android but as soon as we tried to prepare the build for ios it stopped working, so more or less the api is responding to RAW JSON [specially in case of ios].

PHP code:

after searching for days I came to know that in case of android we send form-data while in case of ios we send RAW data and that is the issue.

when used json_decode(), it actually solved the issue on ios front but the android app stopped working, so I am back to square one.

ionic code
home.ts file where I call the api

service file


I need a solution so that one code base can be used for both android and ios

Thank you in advance


Please stop posting screenshots of text.