I’ve been creating alerts via the API for a week or so now and everything has been working fine, however an alert I created last night expired and went inactive around the time the plane landed. I never got an arrival push notification however, and checking in my notifications tab it appears one was never sent, though one was sent for departure. Is there a reason this happened? Hasn’t happened before but would be very inconvenient if this randomly happens every now and then.
Are you sure you did not unintentionally set and ending date for the alert? They will automatically go to disabled when the ending date is reached.
I set the start date and end date to 9/26/2014 (in epoch time using the exact same value for both) so that way it would only alert me of the flight yesterday. The alert went inactive around 9pm cst last night.
What is the ident (or faFlightID) of the flight you are looking at?
In general, if you receive the departure alert then you should receive the arrival alerts for it, even if the end_date occurs while the flight is still enroute. However, some flights that occur partially in areas where our data coverage is limited may mean that the arrival could not be confirmed, so you might not get the arrival alert. These flights are usually shown on our website as “result unknown”
The ident was DAL5957 (or TCF5957) on Friday September 26, LGA to ORD
I had the exact same issue last night, but this time it only sent a flight plan and one update. No departure or arrival notifications were received. The flight was TCF5957 from LGA -> ORD on 10/13/2014. When I go to the push notification testing interface to see what was pushed it only shows the two notifications, meaning it didn’t even attempt to send any more. Please let me know if there’s a way to fix this.
We have logged an internal bug 32293 about your original report, but there is no current resolution. We recommend ensuring that your end timestamp is beyond the expected arrival time to ensure that it will not become inactive prematurely. Once you receive the arrival, you can explicitly use DeleteAlert to remove it and prevent any subsequent flights from triggering alerts.
My understanding was that that should not be an issue, since if I set start and end time to the exact same day it will create an alert for the whole day. When I go into My Alerts and look at any alert I’ve created, it shows that it is for one entire day. I also thought I was supposed to set the start and end date to the same value, per the documentation.
Also, I currently use the DeleteAlert function on receiving an arrival code, however I am hesitant to rely solely on that to delete my alert since as I’ve experienced, there’s no guarantee to receive an arrival alert.
The start and end times supplied to SetAlert are unconditionally rounded down to day accuracy, so it’s not necessary for you to attempt to be precise with the times.
As I mentioned, there is apparently a bug in the alerting system that may cause it to end before the arrival occurs. I offered you the suggestion of extending the end date as a workaround to avoid that unintended behavior for now. The intended behavior is that you receive all requested alerts for the flight as long as your date range matches the departure.
Setting an ending date that is more than long enough to include the arrival date should be an adequate workaround. I mentioned the possibility of deleting the alert upon receipt of any arrival message for your flight as an optimization, not as a substitute for setting a lengthened arrival date. You should not have the expectation that all flights will necessarily have an arrival alert, particularly if the arrival side of the flight is outside of our coverage areas.
When using a lengthened arrival date, you should be aware that you may receive alerts for flights on the subsequent day, which may not be the same flight that you are interested in. Because of this, your code should probably check to see that the departure date of all alerts actually match the date you are expecting and then ignore those alerts for the later day. (You can consider calling DeleteAlert when you receive any alert for the next day’s flight if you are careful to ensure that the prior flight should have already landed.)