The courts interpret the requirement of a written demand quite liberally.
They may waive the requirement if the circumstances make it clear that the insecure party can reasonably suspend its performance until it receives adequate assurance that the other party will perform.