cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1091
Views
0
Helpful
7
Replies

getMeeting() returning error code of undefined

chshipma
Cisco Employee
Cisco Employee

I'm trying to use getMeeting() when using the Embedded App SDK and am getting undefined as an error coming back from a rejected promise.

 

How do I troubleshoot this?

 

Details:

Webex Meetings Version: 42.3.6.11

Platform: Mac OS 12.3 (21E230)

1 Accepted Solution

So, I sorted out my issue, but I'm not sure why it worked. here's the code context.

 

I am using EmberJS to develop my embedded app. To aid in this, I've made an EmberJS Addon (found here, it's still a WIP) which essentially wraps the Embedded App SDK with Ember conventions to enable some data-binding in the templating engine.

 

When my app boots up, it initializes the addon, which in turn creates an instance of the SDK.

In ADDON:
this._webexInstance = new window.Webex.Application();

...which I then immediately setup the promise chain to respond to the onReady() event:

In ADDON:
this._webexInstance.onReady().then(() => { })

Once the instance reports that it's ready, I then go and fetch the user. Once the user is resolved, I then resolve the promise that was blocking my app from booting.

 

It was here that I was then calling "getMeeting()" to get the meeting details. Here's the high-level sequence.

In Addon: OnReady() -> onReadyHandler() -> context.getUser() -> context.getMeeting()

The change I made to get it to work was to remove the final step and call it, more deliberately from the consuming app:

In Addon: OnReady() -> onReadyHandler() -> context.getUser()

In my addon, I have an accessor function for the meeting details call, like this:

ADDON CODE:

_cachedMeetingPromise: undefined; get meeting(): Promise<any>{ let retVal = this._cachedMeetingPromise ? this._cachedMeetingPromise : this.localDev ? Promise.resolve(this.fakedMeetingInfo) : this.context.getMeeting(); this._cachedMeetingPromise = retVal; retVal.then((meetingInfo: any)=>{ this.currentRoles = meetingInfo.userRoles; this._cachedMeetingPromise = undefined; console.log("WEBEX for getMeetings: ", meetingInfo) }).catch((error:any) =>{ this._cachedMeetingPromise = undefined; // @ts-ignore console.log("WEBEX ERROR for getMeetings: ", Webex.Application.ErrorCodes[error]) }) return retVal; }

Which I then call in the consuming app like this:

APP CODE:

        this.webex.meeting.then((meeting: any)=>{
          this.websocket.connect(meeting);
        }).catch((error)=>{
          console.log("WEBEX IN APP: ERROR FOR GET MEETING", error);
        })

This seems to be working now. I suppose it's possible that the sequencing and timing between calls could have caused an issue.

View solution in original post

7 Replies 7

Hi @chshipma , thanks for your question! Would you add the platform (Mac/Win) and client version of Webex where you're experiencing this?

 

Some things to check for in general:

  • When you created your Embedded App at developer.webex.com, did you click the box for Meetings (there's one for Meetings and Messaging) to specify that it can be used in Meetings?
  • Is PII (Personally Identifiable Information) on or off for your app?
  • Is the app in development status, or has it been approved by your org admin?

Thanks for adding additional info for us on this.

Thanks for the reply, I modified my original post to contain the extra version information.

 

  • When you created your Embedded App at developer.webex.com, did you click the box for Meetings (there's one for Meetings and Messaging) to specify that it can be used in Meetings?
    • Yes, I have both Meeting and Messaging checked
  • Is PII (Personally Identifiable Information) on or off for your app?
    • It's enabled
  • Is the app in development status, or has it been approved by your org admin?
    • It is in development mode. I submitted (not fully aware of the process) and it's just saying "Submitted"

Further, I decided to deploy the kitchen sink app in my dev account and I can mash the "getMeeting()" button and get information back about the meeting every time.

Thanks for these details @chshipma ! One more question: does your code wait for `onReady()` to resolve before attempting to access methods and properties?

So, I sorted out my issue, but I'm not sure why it worked. here's the code context.

 

I am using EmberJS to develop my embedded app. To aid in this, I've made an EmberJS Addon (found here, it's still a WIP) which essentially wraps the Embedded App SDK with Ember conventions to enable some data-binding in the templating engine.

 

When my app boots up, it initializes the addon, which in turn creates an instance of the SDK.

In ADDON:
this._webexInstance = new window.Webex.Application();

...which I then immediately setup the promise chain to respond to the onReady() event:

In ADDON:
this._webexInstance.onReady().then(() => { })

Once the instance reports that it's ready, I then go and fetch the user. Once the user is resolved, I then resolve the promise that was blocking my app from booting.

 

It was here that I was then calling "getMeeting()" to get the meeting details. Here's the high-level sequence.

In Addon: OnReady() -> onReadyHandler() -> context.getUser() -> context.getMeeting()

The change I made to get it to work was to remove the final step and call it, more deliberately from the consuming app:

In Addon: OnReady() -> onReadyHandler() -> context.getUser()

In my addon, I have an accessor function for the meeting details call, like this:

ADDON CODE:

_cachedMeetingPromise: undefined; get meeting(): Promise<any>{ let retVal = this._cachedMeetingPromise ? this._cachedMeetingPromise : this.localDev ? Promise.resolve(this.fakedMeetingInfo) : this.context.getMeeting(); this._cachedMeetingPromise = retVal; retVal.then((meetingInfo: any)=>{ this.currentRoles = meetingInfo.userRoles; this._cachedMeetingPromise = undefined; console.log("WEBEX for getMeetings: ", meetingInfo) }).catch((error:any) =>{ this._cachedMeetingPromise = undefined; // @ts-ignore console.log("WEBEX ERROR for getMeetings: ", Webex.Application.ErrorCodes[error]) }) return retVal; }

Which I then call in the consuming app like this:

APP CODE:

        this.webex.meeting.then((meeting: any)=>{
          this.websocket.connect(meeting);
        }).catch((error)=>{
          console.log("WEBEX IN APP: ERROR FOR GET MEETING", error);
        })

This seems to be working now. I suppose it's possible that the sequencing and timing between calls could have caused an issue.

Hi Chuck, which specific code is returned for the rejected promise? Here are the error code descriptions  if this helps.

It’s returning undefined. 

Tested this with just a button that calls a getMeeting function and it correctly returned.
Button in HTML file.

<button onclick="getMeeting()">Get Meeting</button>

Function in the JS file.

function getMeeting() {
  app.context.getMeeting().then((m) => {
    console.log('getMeeting()', m);
  }).catch((error) => {
    console.log('getMeeting() promise failed with error', Webex.Application.ErrorCodes[error]);
  });
}