GCM推送邮件编码 [英] GCM push message encoding

查看:141
本文介绍了GCM推送邮件编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下code发送推送通知:

I am trying to send push notifications using following code:

    Message message = new Message.Builder().addData("appName", appData.name)
.addData("message", pushData.message).build();

在接收端我的code是:

On the receiving side my code is:

String message = intent.getStringExtra("message");

当该消息是在英语,拉丁语字符集,一切正常。然而,当我尝试其他语言或字符c,他们到达为问号或从字符串被删除。

When the message is in English, latin charset, everything works. However, when I try other languages or the character ç, they arrive as question marks or are deleted from the string.

请注意:这是EN codeD以UTF-8

Note: it's encoded in utf-8

推荐答案

突破与调试器和查看你认为你发送消息的字节

Break with the debugger and view the bytes of the message you think you're sending

这篇关于GCM推送邮件编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆