question

Sukhminder Arora avatar image
Sukhminder Arora asked Sukhminder Arora edited

How to determine embeddable has initialized

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

embeddable
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

0 Answers

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys