通过OneSignal发出带重音(á,é,í)的推送通知

时间:2017-06-28 14:12:04

标签: java onesignal

每当我尝试通过OneSignal发送带重音(á,é,í)的推送通知时,我的手机上都会出现空符号。

1 个答案:

答案 0 :(得分:0)

我修复了此问题,将我的邮件编码为UTF-8

String payload   =   "{"
   + "\"app_id\": \"" + APP_ID + "\","
   + "\"filters\": [{\"field\": \"tag\", \"key\": \"company\", \"relation\": \"=\", \"value\": \"" + companyID + "\"}],"
   + "\"data\": {\"foo\": \"bar\"},"
   + "\"contents\": {\"en\": \" " + notification + "\"}"
   + "}";

byte[] data = payload.getBytes("UTF-8");

我还将内容类型设置为application/json; charset=UTF-8