Question

How to determine embeddable has initialized

  • 15 November 2020
  • 0 replies
  • 169 views

Hi,

After looking at several code samples and existing documents, it's unclear how to determine if the embeddable has loaded and is ready to register new services etc. (e.g. run a script to register a callLogger and other services).


For example, this doc suggests that we can listen to the 'rc-ev-init' message, but that doesn't appear to work on the latest embeddable.

https://developers.ringcentral.com/engage/voice/guide/embeddable/get-started#inject-into-web-app


Additional Considerations:

At first, i was trying to register services after the 'ringcentral-embeddable/adapter.js' script itself loaded, but that wasn't working, and I discovered I needed to wait further before being able to successfully register a service.

I've tried console logging all events after the script load, to confirm there is no message of type ' 'rc-ev-init' that was referenced in the link above.

The messages that do appear in the console sometimes repeat, whereas i'm looking for an initialization event I can rely on that also only occurs once.

Ideally, unlike the documented example, there would be an approach for running my own initialization code that doesn't require me to create an event listener that runs indefinitely with no hook for knowing when it can be torn down.


Advice appreciated.


Thank you,


-S. Arora


0 replies

Be the first to reply!

Reply