bogkonstantin / android_income_sms_gateway_webhook

Simple Android incoming SMS to URL forwarder
MIT License
388 stars 109 forks source link

wrong json format on multi line text #27

Closed parsibox closed 1 year ago

parsibox commented 1 year ago

hi your json format on multi line text is not valid please review it %text% for example this is wrong "first line second line"

it should be like this : "first line\nsecond line" ( this is true )

parsibox commented 1 year ago

this is sample of your wrong json you can check it with this site https://jsonlint.com/

{
  "from":"+9890001027",
  "text":"خرید به صرفه در دیلی مارکت
٢ الی٤بهمن

پودر ماشین اکتیو۱۵۹۵۰ت
دستمال توالت تا۲۰%
رب خوشبخت۳۵۵۰۰ت
حبوبات تا۲۰%
چای شهرزاد تا۲۰%

لغو=١١",
  "sentStamp":1674367653000,
  "receivedStamp":1674367655339,
  "sim":"sim1"
}
bogkonstantin commented 1 year ago

The app doesn't trim \n symbols. Usually - the interface where you see JSON does that.


You can see it in screenshots - internal and external received data:

image image

When you copy-paste it (from the Raw Content on the 2nd screenshot) you are getting the wrong JSON:

image