当我将 int json 数据设置为 message 时,它会在本地自动更改为 double 类型。
// The json send to HMS server.
{
"validate_only": false,
"message": {
"data": "{'int_type':0}",
...
}
// The data received locally.
{ int_type=0.0 }
最佳答案
方法一:将所有int类型改为string。
方法二:以json方式传入字符串,本地转为int。
"message": {
"data": "{'int_type':'0'}",
int_type.toInt()
关于huawei-mobile-services - json int数据类型自动变为double,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69242118/