问题
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