Implementation based on http://dev.webinos.org/specifications/draft/appstatesync.html