Some background reading at first :) what is shutdown handling
I'm doing a custom receiver with CAF SDK.
With the similar shutdown handling, I try to dispatch some http requests within the callback like:
receiver.addEventListener(
cast.framework.system.EventType.SHUTDOWN,
e => {
// some http requests
HttpHandler.post(url, somePayload);
HttpHandler.post(anotherUrl, someOtherPayload);
....... (more requests to go)
});
However, I can't guarantee those requests are reaching the destination since the receiver application is about to terminate anytime(Likely less than 1 sec).Those requests were also proved not reaching the destination in fact.
As far as I know, there is no way to postpone the shutdown of the receiver application with CAF SDK itself.
Is there a workaround about it? Is there a way we can postpone shutdown with the help of CAF SDK?