Forum Discussion

Kameshm05's avatar
Kameshm05
Copper Contributor
Oct 10, 2021

Teams Personal App Development

I was developed a teams personal app with "Teams ToolKit". The app is working well in the web version of Teams. But In desktop and Mobile client not working properly. My personal app contains a module about fetching current and all users details using GraphClientfactory.  My app failed to load when calling the graph API module. In the web version, it's working correctly. I don't know what is the issue arise when calling graph call? 

 

Here anyone faces the same issue?
please help me. I am stuck for about 2 weeks.

Thanks In advance.

  • Kameshm05 - Could you please the Graph API docs which you are referring, so that we can test it from our end.
    Also could you please share the console log/error details from Teams Desktop client.
    • Kameshm05's avatar
      Kameshm05
      Copper Contributor

      ChetanSharma-msft hi Chetan Sharma, Thanks for the reply. I am referred the below link for graph call
      https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph

       

      In the web version, there is no issue , data loaded correctly. But In the desktop version issue arose.
      I am using the alert popup to lock the error message. But that message is shown as undefined. In the log not showing enough details to trace the issue.

      I am using the below code in my ts file

            this.context.msGraphClientFactory
              .getClient()
              .then((client: MSGraphClient): void => {
                alert(client)
                this.graphClient = client;
                resolve();
              }, err => reject(err));

      I am using the below code in my TSX file

            const currentUser = await this.props.graphClient.me().then(async (user,error) => {
              if(error) {
                alert(JSON.stringify(error));
              }
              alert(user.mail)
            });

       

      Thanks, Chetan Sharma

       

Resources