【问题标题】:Urban Airship throws error After successfully sending a schedule push notificationUrban Airship 在成功发送日程推送通知后抛出错误
【发布时间】:2019-02-08 16:17:07
【问题描述】:

我使用 UrbanAirship 发送推送通知,它就像一个魅力。但是,当我尝试设置计划推送通知时,它会在成功创建计划推送通知后抛出 RuntimeException("Failed to retrieve response from future")。

我的 Java 应用程序收到 RuntimeException,但我的移动设备按预期收到推送通知。有谁知道为什么 UrbanAirship 即使成功发送通知也会抛出此异常。这似乎很奇怪,我找不到任何理由。有人可以帮忙吗?

DateTime threeHoursBeforePickup = getThreeHoursBeforePickup(pickUpDate);
Schedule schedule = buildSchedule(threeHoursBeforePickup);
PushPayload pushPayload = generatePayload();

UrbanAirshipClient client = getClient();
ScheduleRequest scheduleRequest = ScheduleRequest.newRequest(schedule, pushPayload);
Response<ScheduleResponse> response = client.execute(scheduleRequest);
return response;

我的代码永远不会到达 return 语句。

【问题讨论】:

    标签: java push-notification urbanairship.com


    【解决方案1】:

    我仍然没有找到任何关于这个问题的答案,但是,我已经回到版本 0.3.1 并使用了来自 https://docs.urbanairship.com/reference/libraries/java/0.3.1/#send-scheduled-push 的文档并且它没有任何问题。

    所以,使用 0.3.1

    <dependency>
        <groupId>com.urbanairship</groupId>
        <artifactId>java-client</artifactId>
        <version>0.3.1</version>
    </dependency>
    

    【讨论】:

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