diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp index 7dabadf3b76d28e48e1d2e962bbb2521bb25898e..ce5393b13dc2a6bf3ca389b7535376426323b6b2 100644 --- a/src/dht_proxy_server.cpp +++ b/src/dht_proxy_server.cpp @@ -1004,7 +1004,13 @@ DhtProxyServer::sendPushNotification(const std::string& token, Json::Value&& jso notification["platform"] = type == PushType::Android ? 2 : 1; notification["data"] = std::move(json); notification["priority"] = highPriority ? "high" : "normal"; - notification["time_to_live"] = 3600 * 24; // 24 hours + if (type == PushType::Android) + notification["time_to_live"] = 3600 * 24; // 24 hours + else { + const auto expiration = std::chrono::system_clock::now() + std::chrono::hours(24); + uint32_t exp = std::chrono::duration_cast<std::chrono::seconds>(expiration.time_since_epoch()).count(); + notification["expiration"] = exp; + } Json::Value notifications(Json::arrayValue); notifications[0] = notification;