-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
A flow's token is used to resume previously started flows. If a subsequent CTA for the same flow with the same token is received, WhatsApp will consider it a continuation of a previously started one and potentially present partially filled data to continue.
Developers might want to limit that time (defaults to no TTL, basically unless an actual token is provided), so a convenience TimeSpan-based approach can be provided.
It can be as simple as a time bucket such as:
long seconds = DateTimeOffset.UtcNow.ToUnixTimeSeconds() / 60; // use minutes
long window = (long)TimeSpan.FromDays(3).TotalSeconds / 60; // minutes too
long bucket = (seconds/ window);Since flows under a minute of TTL are really impractical (users won't have time to even complete one in that time, so continuing for longer time seems reasonable), we turn seconds to minutes so the resulting bucket number is smaller. 3 days is also something mentioned even in the docs.
Perhaps this should be an overload of CallToAction(...) for the flow-based overloads?
