简体   繁体   English

成功发送时间表推送通知后,Urban Airship引发错误

[英]Urban Airship throws error After successfully sending a schedule push notification

I use UrbanAirship to send push notification and it works like a charm. 我使用UrbanAirship发送推送通知,它的工作原理很像。 However, when I try to setup schedule push notification, it throws RuntimeException("Failed to retrieve response from future") AFTER successfully create a scheduled push notification. 但是,当我尝试设置计划推送通知时,在成功创建计划的推送通知之后,它会抛出RuntimeException(“ Failed to get response from future”)。

My Java application get a RuntimeException but my mobile devices receive push notification as expected. 我的Java应用程序收到RuntimeException,但我的移动设备收到了预期的推送通知。 Does anyone know why UrbanAirship throws this exception even when it has sent the notification successfully. 没有人知道为什么UrbanAirship即使成功发送了通知也会引发此异常。 It seems very strange and I cannot find any reasons for it. 似乎很奇怪,我找不到任何原因。 Can anyone help, please? 有人可以帮忙吗?

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;

My code never reach the return statement. 我的代码永远不会到达return语句。

I still have not found any answer to this issue, However, I have gone back to version 0.3.1 and used documentation from https://docs.urbanairship.com/reference/libraries/java/0.3.1/#send-scheduled-push and It worked with no issue. 我仍然没有找到这个问题的答案,但是,我回到了0.3.1版本,并使用了https://docs.urbanairship.com/reference/libraries/java/0.3.1/#send-scheduled中的文档-push并且没有问题。

So, use 0.3.1 因此,请使用0.3.1

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM