Teams Personal App Development

%3CLINGO-SUB%20id%3D%22lingo-sub-2831368%22%20slang%3D%22en-US%22%3ETeams%20Personal%20App%20Development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2831368%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20developed%20a%20teams%20personal%20app%20with%20%22%3CSTRONG%3ETeams%20ToolKit%3C%2FSTRONG%3E%22.%20The%20app%20is%20working%20well%20in%20the%20web%20version%20of%20Teams.%20But%20In%20desktop%20and%20Mobile%20client%20not%20working%20properly.%20My%20personal%20app%20contains%20a%20module%20about%20fetching%20current%20and%20all%20users%20details%20using%20%3CSTRONG%3EGraphClientfactory.%26nbsp%3B%3C%2FSTRONG%3E%20My%20app%20failed%20to%20load%20when%20calling%20the%20graph%20API%20module.%20In%20the%20web%20version%2C%20it's%20working%20correctly.%20I%20don't%20know%20what%20is%20the%20issue%20arise%20when%20calling%20graph%20call%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20anyone%20faces%20the%20same%20issue%3F%3CBR%20%2F%3Eplease%20help%20me.%20I%20am%20stuck%20for%20about%202%20weeks.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20In%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2831368%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELOB%20Apps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Espf%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2832513%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Personal%20App%20Development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2832513%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1181199%22%20target%3D%22_blank%22%3E%40Kameshm05%3C%2FA%3E%20-%20Could%20you%20please%20the%20Graph%20API%20docs%20which%20you%20are%20referring%2C%20so%20that%20we%20can%20test%20it%20from%20our%20end.%3CBR%20%2F%3EAlso%20could%20you%20please%20share%20the%20console%20log%2Ferror%20details%20from%20Teams%20Desktop%20client.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2832557%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Personal%20App%20Development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2832557%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1096313%22%20target%3D%22_blank%22%3E%40ChetanSharma-msft%3C%2FA%3E%26nbsp%3Bhi%20Chetan%20Sharma%2C%20Thanks%20for%20the%20reply.%20I%20am%20referred%20the%20below%20link%20for%20graph%20call%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fuse-msgraph%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fuse-msgraph%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20web%20version%2C%20there%20is%20no%20issue%20%2C%20data%20loaded%20correctly.%20But%20In%20the%20desktop%20version%20issue%20arose.%3CBR%20%2F%3EI%20am%20using%20the%20alert%20popup%20to%20lock%20the%20error%20message.%20But%20that%20message%20is%20shown%20as%20undefined.%20In%20the%20log%20not%20showing%20enough%20details%20to%20trace%20the%20issue.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20using%20the%20below%20code%20in%20my%20ts%20file%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%20%20%20%20%20%20this.context.msGraphClientFactory%0A%20%20%20%20%20%20%20%20.getClient()%0A%20%20%20%20%20%20%20%20.then((client%3A%20MSGraphClient)%3A%20void%20%3D%26gt%3B%20%7B%0A%20%20%20%20%20%20%20%20%20%20alert(client)%0A%20%20%20%20%20%20%20%20%20%20this.graphClient%20%3D%20client%3B%0A%20%20%20%20%20%20%20%20%20%20resolve()%3B%0A%20%20%20%20%20%20%20%20%7D%2C%20err%20%3D%26gt%3B%20reject(err))%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20am%20using%20the%20below%20code%20in%20my%20TSX%20file%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%20%20%20%20%20%20const%20currentUser%20%3D%20await%20this.props.graphClient.me().then(async%20(user%2Cerror)%20%3D%26gt%3B%20%7B%0A%20%20%20%20%20%20%20%20if(error)%20%7B%0A%20%20%20%20%20%20%20%20%20%20alert(JSON.stringify(error))%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20alert(user.mail)%0A%20%20%20%20%20%20%7D)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%20Chetan%20Sharma%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2836626%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Personal%20App%20Development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2836626%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1181199%22%20target%3D%22_blank%22%3E%40Kameshm05%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3ECould%20you%20please%20have%20a%20look%20at%20the%20solution%20provided%20over%20here%20and%20see%20if%20it%20helps%20anyway.%20Its%20in%20similar%20line%20as%20you%20are%20facing%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F59860729%2Fspfx-webpart-in-msteams-desktop-client-throws-an-unauthorizedaccessexception%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Esharepoint%20-%20SPFx%20webpart%20in%20MSTeams%20Desktop%20Client%20throws%20an%20UnauthorizedAccessException%20-%20Stack%20Overflow%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2836667%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Personal%20App%20Development%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2836667%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1092859%22%20target%3D%22_blank%22%3E%40Prasad_Das-MSFT%3C%2FA%3E%3CBR%20%2F%3EThanks.%20I%20am%20done%20with%20the%20step%20mentioned%20in%20that%20article.%20But%20my%20manifest%20JSON%20is%20already%20in%20the%20correct%20format.%20But%20I%20don't%20know%20what%20is%20the%20issue%3F%3C%2FLINGO-BODY%3E
New Contributor

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.

6 Replies
@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.

@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

 

@Kameshm05 
Could you please have a look at the solution provided over here and see if it helps anyway. Its in similar line as you are facing
sharepoint - SPFx webpart in MSTeams Desktop Client throws an UnauthorizedAccessException - Stack Ov...

@Prasad_Das-MSFT
Thanks. I am done with the step mentioned in that article. But my manifest JSON is already in the correct format. But I don't know what is the issue?

@Kameshm05 
Please have a look on this once and let us know if it helps

@Kameshm05 - Could you please confirm if your issue has resolved with above suggestion or still looking for any help?
www.000webhost.com