Closed paulogc closed 2 years ago
Hi @paulogc! Thanks for reaching out. Unfortunately the subscribeToFeedUpdates
callback is only invoked when the network call is successful. We can look into ways to improve how we expose network failures across the SDK.
Depending on your use case, you may be able to use the below workaround in the meantime. This workaround is obviously not ideal and it doesn't give you insight into why the refresh failed, but it works if you just need to log that the feed refresh was unsuccessful.
// callback is invoked on all successful calls
let callbackInvoked = false;
const subscriptionCallback = feed => {
callbackInvoked = true;
// other feed code
};
appboy.subscribeToFeedUpdates(subscriptionCallback);
appboy.requestFeedRefresh();
setTimeout(() => {
if (!callbackInvoked) {
log('Feed refresh was not successful');
}
callbackInvoked = false;
}, 30000); // arbitrary timeout value; feel free to change
Hi @wesleyorbin, thank you for your quick feedback. I believe would be good if we also have ways to access network failures as we have when there are success. The workaround may work for me now.
I Appreciate your help and support.
We've since added better callback handling for Content Cards (see v3.3.0 changelog). Unfortunately we will not be adding this to Newsfeed and recommend clients migrate to our newer Content Cards channel.
Hello guys,
First ehnak you all for the awesome work, I have a question about the news feed.
In case there are errors when fetching news feed (specially server errors), I would like to handle it log it in a custom way. There is
subscribeToFeedUpdates
that I can use to watch for feed updates, but is this going to handle errors?What I want to do is something like:
Thanks in advance.