Closed GeorgeTaveras1231 closed 4 years ago
Thanks for the feedback @GeorgeTaveras1231 - that's an interesting use-case! The reason we marked messageReadyCallback
as deprecated is because we solved the main purpose that it had been written for internally (ensuring that available in-app messages finish syncing before events that are supposed to trigger them fire). Their presence was somewhat confusing for some integrators though and implied (incorrectly) for a lot of people that the SDK was totally unready for use after calling openSession
or changeUser
until those callbacks had been invoked. I follow your use-case though and the value that it is providing for you.
In the long term, I wonder if a cleaner way of ensuring that use-cases like yours function as desired would be for us to introduce a completion callback to appboy.requestImmediateDataFlush
- something like that would also function for various other event-flushing-plus-navigation use-cases, even for integrators that don't conveniently have a new user id to call changeUser
with like you do. And then we could ensure internally that things like
appboy.changeUser("new user id");
appboy.requestImmediateDataFlush(function() {
document.location = "https://new-url.com"
});
work as desired
Does something like that seem like it would solve your use-case?
In the short term, rest assured that we have no immediate plans to remove the messageReadyCallback
functionality, and now that you've raised this use-case we'll make sure we at least have a satisfying answer to keep that working before we consider making any changes.
Thanks for the response @froodian! Yes, something like that should work, as long as the callback is called after the data has successfully been sent to braze. And thanks for reassuring me that messageReadyCallback
won't be going away soon. But in the case it does, is there a way for me to be notified directly? Is there some sort of release notification system in place that I can subscribe to? Or what would be the best way to find out ASAP?
Sounds good - I've filed this work internally with dependencies such that any future removal of messageReadyCallback
will be blocked on having a replacement solution like this present, and I've also linked back to this issue to ensure that you're proactively notified when we prioritize that work.
In terms of the larger release notification question, you could potentially use the https://github.com/Appboy/appboy-web-sdk/releases.atom feed - if you don't already use an RSS reader regularly you could potentially set up email notifications based on that - a quick google for "rss feed email notification" shows some ways of getting entries from a feed like that into an email inbox.
@froodian thanks for thoughtfully handling this on your side. As far as getting notified. If you are planning on sharing progress via this issue, I'm happy with subscribing to the issue since GH will send me email notifications.
Hi @GeorgeTaveras1231! We just released version 2.5.0, which adds a completion callback to appboy.requestImmediateDataFlush
as discussed above.
I'm going to close out this issue for now, but should you have any issues with the new callback, feel free to re-open.
I see in this change log that
messageReadyCallback
is being deprecated.However, we've relied on this to ensure the proper timing of events in scenario's where the user is being redirected, and we want to wait for all analytics calls to finish (specifically in our sign up flows).
Our order of events is:
appboy.changeUser
If we don't have a way to wait for the async
changeUser
call to finish, then we risk missing some of those calls, since a redirect will force ongoing requests to be canceled.So will there be another way to wait for that call to finish? Or can you reconsider the fate of the
messageReadyCallback
?