客户端要求将OneSignal与其Android和iOS应用程序集成。早些时候,他们正在使用开放式式通知通知。以以下格式以iOS和Android应用中收到的有效载荷:
{ "aps": { "alert": { "loc-key": "WATCH_VIDEO", "loc-args": ["Mo Adham", "Simpson's theme on Two guitars"]}, "guid": "1GSIP6J" } }
当我在OneSignal仪表板中查找时,他们无法选择创建自定义有效载荷。我希望从Onesignal中以上格式的有效载荷。目前来自仪表板,onsignal以这种格式发送有效载荷:
{
aps = {
alert = {
body = hello;
subtitle = test;
title = test;
};
sound = default;
};
custom = {
i = "db7e56d9-df72-4ec3-adbe-1cd8e1c5d327";
};
}
键在两个有效载荷中都不匹配。我想问的是,客户是否需要在后端整合OneSignal,以便他们可以以指定格式发送有效载荷?
查看有关丰富通知,操作按钮和自定义操作按钮的文档。下面提到的链接。如果仍然没有帮助,请与他们的客户支持聊天。
https://onesignal.com/blog/sending-rich-notifications-in-ios10-with-onesignal/https://documentation.onesignal.com/docs/action-buttonshttps://documentation.onesignal.com/docs/customize-actor-buttons
尝试使用Create Notification
我在Postman中进行了测试
POST - https://onesignal.com/api/v1/notifications
将其添加到标题中
Authorization: Basic FETVGER2dsaftOWQ3MS00NmQ2LTlmYmYtODkz34dasgYzkx
(授权:基本您的REST API键(
{
"app_id": "d7c310b5-f2b6-4e84-8f91-c3e4b77c2904",
"included_segments": ["Subscribed Users"], //To send all user
"include_player_ids": ["6392d91a-b206-4b7b-a620-cd68e32c3a76","76ece62b-bcfe-468c-8a78-839aeaa8c5fa","8e0f21fa-9a5a-4ae7-a9a6-ca1f24294b86"], //To specific user using player id
"content_available": true
}
REST API键 - 在此处找到