【问题标题】:setExpirationTimeInterval doesn't work on parse.comsetExpirationTimeInterval 在 parse.com 上不起作用
【发布时间】:2023-03-16 12:19:01
【问题描述】:

我尝试使用过期时间间隔发送推送,但它没有发送到服务

long weekInterval = 60*60*24*7; // 1 week

            // Send push notification with expiration interval
            ParsePush push1 = new ParsePush();
            push1.setExpirationTime(weekInterval);
            push1.setQuery(ParseInstallation.getQuery().whereEqualTo("deviceType", "android"));
            push1.setMessage("Season tickets on sale until November 20th");
            push1.sendInBackground();

但在服务器端的通知描述是这样的

目标:

deviceType is "android"
Sending date :
November 14th, 2014 at 5:42 PM
Expiration :
None
Full target :
{ "deviceType": "android" }
Full data :
{ "alert": "Season tickets on sale until November 20th" }

如您所见,过期是

更新: 同样的行为是: setExpirationTimeInterval()

是我的错误还是服务的?

【问题讨论】:

  • 我似乎也收到了应该过期的推送。我从 Cloud Code 发送。
  • 我已经测试了你的代码,它对我有用。

标签: android notifications parse-platform push


【解决方案1】:

我认为你需要使用:

setExpirationTimeInterval()

而不是 setExpirationTime()

(设置特定的时间戳而不是持续时间)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多