Skip to content

android notification带extra,发送失败 #1

@hugecheng

Description

@hugecheng

代码如下:

char extras[10] = {0};
sprintf(extras, "{\"event_id\":%d}", 100);
printf("extras: %s\n", extras);
char* msg = cJSON_Print(cJSON_Parse(extras));
printf("cjson extras: %s\n", msg);

// 设置ios平台的notification
setIosApns(note, "ios alert", "sound", 1, 1, 1, "category", msg);

// 设置安卓平台的notification
setAndroidApns(note, "android alert", "android title", 1, 2, J_PUSH_STRING_NULL, J_PUSH_INT_NULL, J_PUSH_INT_NULL,  “android big text", "android big pic", msg);

返回的打印如下:

return:{"msg_id": 36028797320475286, "error": {"message": "android extras must be json object", "code": 1003}}

麻烦看下是什么问题?谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions