Forum Discussion
Question about MS Teams SDK for app.initialize/ app.getContext
- Sep 24, 2024
byungheesohn, the times you mentioned: around 380ms for Web Teams in Chrome and 130ms for Desktop Teams, are within a reasonable range, but there are ways to optimize and potentially reduce this delay. Using URL placeholders can be a more efficient way to access context information without the delay associated with
app.getContext.By using URL placeholders, you can directly embed the locale information in your URLs, which can help reduce the delay.
const url = `https://your-app-url.com?locale={app.locale}`;Get Contextual Information for Tabs - Teams | Microsoft Learn
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.
Dear Sir
I have one additional question, which is about "window.navigator".
I found that "language" from window.navigator has the same locale with that (app.locale) of url placehoder when I use desktop native Teams app.
However, when I use web Teams, the result shows below
- window.navigator : browser locale
- app.locale : teams locale
Is it true?
Many thanks
BH
byungheesohn Yes, you can use window.navigator.language to obtain the default locale for your Microsoft Teams app.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link.
- byungheesohnOct 31, 2024Brass ContributorDear Prasad Das
I have uploaded another issue below.
https://techcommunity.microsoft.com/t5/teams-developer/unknown-crossbar-on-teams-tab/m-p/4276965/highlight/true#M11023.
As you know, I'm using "URL placehoder" not MS client sdk lib(app.initialize().then ~).
From unknow crossbar of above another issue of Community, is it related to URL placehoder.?
Then, Do I have to use ms teams sdk regardless of using URL place hoder?
Many thanks
BH - byungheesohnSep 25, 2024Brass ContributorThanks for the confirmation
BH