I followed the steps listed in MS Teams official documentation - https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/add-tab
I am trying to add my CakePHP web application into teams/group chat. I also tried creating configuration page to communicate between MS Teams and my web application but it didn't worked.
I have used CakePHP framework for my web app hence using it's default layout to create configuration page. Below is the code I have added in default layout page.
<script src="https://statics.teams.cdn.office.net/sdk/v1.8.0/js/MicrosoftTeams.min.js"></script>
<script>
microsoftTeams.initialize();
microsoftTeams.settings.registerOnSaveHandler((saveEvent) => {
microsoftTeams.settings.setSettings({
websiteUrl: "My website URL",
contentUrl: "My content URL(which is same as my website URL)",
entityId: "unique entity id that is mentioned in the app manifest file",
suggestedDisplayName: "My tab name"
});
saveEvent.notifySuccess();
});
microsoftTeams.settings.setValidityState(true);
</script>
I am not getting any error either but after adding my web app in tab, save button is disabled hence I am unable to save tab.
Refer this image: