How do I implement the messaging between DOM and Service Worker?

0 favourites
  • 4 posts
From the Asset Store
Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably send messages at no cost.
  • I've read the relevant docs. Found the APIs at the instance side, but how does the other side look like? Where and how is PostToRuntimeAsync (and probably PostToRuntime) documented?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've tried to figure it out, but without much luck.

    This is what I see until now.

    I can easily register a script to be run on the main thread. This script is properly concatenated at the end of the exported c3runtime.js.

    From github.com/el3um4s/construct-html-element-plugin, I've figured out that it's probably a wise choice to extend my DOM-side script from DOMHandler. Unfortunately, DOMHandler is undocumented

    Moreover, I've found a C3.SDKDOMPluginBase in the exported c3runtime. This is again undocumented.

    Finally, I've tried to simply send a message from C3 runtime to the DOM. This message sending fails as it's looking for this._domComponentId what is an empty array in my case, and can't figure out from the minified code where should it be populated.

    Is there any possibility to get access to the unminified C3 code to figure out how these scripts should work?

    Or is there an ETA for the documentation to be published?

  • Sorry, looks like an omission from the current docs. I'll try get the documentation on this finished soon.

  • Thanks Ashley!

    Could you post here, when the docs are out?

    Or is it expected to be shipped together with the next/a release?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)