feat(api): expose a way to submit feedback
Spot will need a way to submit call feedback using the iframe api. For now expose a method on conference.js to submit that feedback. Exposing on conference.js looks to be the existing pattern... Also add an event to notify consumers of the iframe api that feedback was submitted, as postMessage is async and the notification can at least give some guarantee maybe. I haven't updated documentation yet as I'm not confident about this api.
This commit is contained in:
@@ -59,6 +59,10 @@ function initCommands() {
|
||||
sendAnalytics(createApiEvent('display.name.changed'));
|
||||
APP.conference.changeLocalDisplayName(displayName);
|
||||
},
|
||||
'submit-feedback': feedback => {
|
||||
sendAnalytics(createApiEvent('submit.feedback'));
|
||||
APP.conference.submitFeedback(feedback.score, feedback.message);
|
||||
},
|
||||
'toggle-audio': () => {
|
||||
sendAnalytics(createApiEvent('toggle-audio'));
|
||||
logger.log('Audio toggle: API command received');
|
||||
@@ -456,6 +460,16 @@ class API {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify external application (if API is enabled) that conference feedback
|
||||
* has been submitted. Intended to be used in conjunction with the
|
||||
* submit-feedback command to get notified if feedback was submitted.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
notifyFeedbackSubmitted() {
|
||||
this._sendEvent({ name: 'feedback-submitted' });
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposes the allocated resources.
|
||||
|
||||
Reference in New Issue
Block a user