Why some special characters are not supported in one signal?

我与影子孤独终老i 提交于 2020-03-23 12:04:25

问题


I am using onesignal to send push notifications to mobile app from my webservice. but I realized that some characters are not supported, what can we do to resolve this issue? below is my postString sent to onesignal:

     postString = "{""app_id"":""myID"",""language"":""ar"", ""tags"" : 
     [{""key"": ""my_key"", ""relation"": ""="", ""value"": """ & my_value& """}] ,
     ""data"" : {""contactName"" : """ & contactName & """ }, 
     ""contents"" : {""en"" : """ & pushMessage & """ } }"

when I tried to send data like +-*/.!@#$%^&*()_+=-?><|":;'\ I got this error: The remote server returned an error: (400) Bad Request. NB: When I changed language to en I got the same error. Any idea?


回答1:


All unicode characters are supported. It's possible that the extra quote in your data caused this issue. Please make sure that your postString is in a valid JSON by escaping any single or double quotes and that should resolve this issue.



来源:https://stackoverflow.com/questions/39847613/why-some-special-characters-are-not-supported-in-one-signal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!