Skip to content
Snippets Groups Projects
Commit 2a50f85a authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

proxy_server: set expiration for iOS devices

parent 26b71ab9
Branches
Tags 2.3.1
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment