sp-dev-docs
sp-dev-docs copied to clipboard
SPFx ACE : Value of "this.context.deviceContext" incorrect in Teams desktop
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Linux
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [ ] 💥 Microsoft Edge
- [ ] 💥 Google Chrome
- [ ] 💥 FireFox
- [ ] 💥 Safari
- [ ] mobile (iOS/iPadOS)
- [ ] mobile (Android)
- [ ] not applicable
- [X] other (enter in the "Additional environment details" area below)
Additional environment details
- Teams desktop app
Describe the bug / error
While developing ACEs, we can get to know the device context using this.context.deviceContext
.
The value of that should one of WebView
, Mobile
or TeamsDesktop
based on where we access the ACE from.
This property gives the correct output when in browser (WebView
) or in Teams mobile app (Mobile
).
However, in Teams desktop app the value is WebView
whereas, it should be TeamsDesktop
.
Steps to reproduce
- Create an ACE using SPFx
- In the onInit method alert the property
this.context.deviceContext
- Open the ACE in Teams desktop app
Expected behavior
In Teams desktop app the value of this.context.deviceContext
should be TeamsDesktop
.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
@anoopt , sorry for our delay in answering. We indeed had some issues in our code that was reporting incorrect information but that should now have been fixed. Can you please check and see if the issue still exists?
Thank you @lucabandMSFT - Tested this with SPFx 1.15.0-beta.1
, the value is correct on the initial load however if you navigate to a different area in Teams and open the Viva connections app, the value shows as WebView
again.
Thanks you @anoopt , looking on the issue now. Also, one question. The "Viva Connections" app you are using is the one that comes out of the box from Teams app, right? it is not this one: https://docs.microsoft.com/en-us/sharepoint/viva-connections-desktop
@anoopt - could you please reply to the Luca's question? Thanks!
Sorry for the delayed response yes, I am using the "Viva Connections" that comes out of the box from Teams app.
@anoopt, thanks. And, to be clear, the issue is happening right now as well? Can you please confirm it?
Sure @lucabandMSFT will test with the latest SPFx version and let you know.
@anoopt - were you able to check if the issue is still repro-ed?
Sorry for the delay in getting back. This can now be closed.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues