OfficeDev / microsoft-teams-library-js

JavaScript library for use by Microsoft Teams apps
https://docs.microsoft.com/microsoftteams/platform/
Other
425 stars 193 forks source link

Teams' JS initialization is failing in SharePoint. #2281

Closed opentextshivam closed 4 months ago

opentextshivam commented 4 months ago

If we use the latest stable version of Teams JS in SharePoint App. It is failing to initialize. It is only working if we use team's version 2.10.0 or less than that.

Since Initialization is failing hence Save button is not enabled for the SharePoint configuration page.

Since Microsoft requested to raise the issue in git hub community hence. We are raising this issue.

For more details, please refer below email communication.

RE_ EXTERNAL - How to add apps to SharePoint - TrackingID#2308110030002391.zip

Existing issue in Microsoft: TrackingID#2308110030002391

Point of Contact from Microsoft: Kengo Mori kenmori@microsoft.com

Use latest version of Teams(teams-js@2.22.0) On adding app to the page Save button is not enabling. image

Use Teams version (teams-js@2.10.0-beta.3 On adding app to the page, Save button is enabled. image

Regards, Shivam sshivam@opentext.com

TrevorJoelHarris commented 4 months ago

Hi @opentextshivam, I'm sorry you've hit this issue. We actually made a change around version 2.10.0 or so that made it so that sharepoint stopped working by default.

Could you try updating your call to app.initialize to look something like this:

app.initialize([`https://yoursite.sharepoint.com`])

Replace https://yoursite.sharepoint.com with the domain of the sharepoint site you're running in, and let me know how that goes!

opentextshivam commented 4 months ago

Hi @TrevorJoelHarris,

Thanks a lot for your input. We are able to load the app in SharePoint.

We have been in a state of struggle for the past 3 months. Could you help us figure out how we can receive updates in case there are any changes in the future?

Regards, Shivam

lucabandMSFT commented 4 months ago

Ho @opentextshivam, sorry to hear that. Just one question: is that a SharePoint Framework application that was created with the Yeoman generator? or something different?

Normally initialization calls should send the name of the host where the app runs (and in fact we do that for SharePoint Framework apps).

The fact your app was still working without the needs to pass the name of the host was a behavior that was not officially documented and we decided to remove as part of a set of improvements we have made to the Teams SDK libraries.

Thanks and regards, Luca Bandinelli

opentextshivam commented 4 months ago

Hi @lucabandMSFT,

We are not using SPFX framework to generate app. It's simple node js app build using Marionette JS and backbone JS.

Regards, Shivam

TrevorJoelHarris commented 4 months ago

Thanks for the extra information @opentextshivam , very appreciated. Once again, we're sorry you ran into this problem and happy we got you unblocked. I'll talk with our documentation team and see if there's some documentation we have that can be updated with this information so others don't run into the same problem.

microsoft-github-policy-service[bot] commented 4 months ago

Tell us about your experience!

Hi opentextshivam! We have closed this issue in our system, but we would love to hear your feedback. To let us know how we did, simply use one of the following emoji icons: :thumbsup: for resolved, :thumbsdown: for unresolved, or :heart: for a great experience on this message. Please use the link for more detailed feedback.

Best regards, Teams Platform

opentextshivam commented 3 months ago

Hi @TrevorJoelHarris ,

We are trying to using microsoftTeams.authentication.getAuthToken in sharepoint to receive the client access token but it is not returning any results.

Any idea what could be an issue? I got one open issue https://github.com/OfficeDev/microsoft-teams-library-js/issues/1407 Which talks about the same thing.

Regards, Shivam