Forum Discussion
Teams App lifecylce questions and approach for external callbacks
- Jul 02, 2024
frapp32 - Typically, the full Angular app will only be loaded when the tab is activated by the user. Static scripts or background services are not initialized directly upon starting Teams. However, you can consider using a bot or proactive messaging to notify the user when there are updates, which might prompt them to open the app tab.
- Bots can be a good solution for sending notifications to users. They can interact with users proactively and can be used to send messages to the user's activity feed when an update is received.- There isn't a unified API that allows notifications in both Teams and Outlook in the same manner. Teams has an activity feed where you can post notifications, but Outlook does not have a similar feature. You might need to use different methods for each application. For Outlook, you could consider using actionable messages or email notifications.
- For connecting to an external service via REST and registering for push updates, you'll need to handle this on the server side. The server can then use the Microsoft Graph API or Bot Framework to communicate with your Teams app and send notifications to users.
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.
frapp32 - Typically, the full Angular app will only be loaded when the tab is activated by the user. Static scripts or background services are not initialized directly upon starting Teams. However, you can consider using a bot or proactive messaging to notify the user when there are updates, which might prompt them to open the app tab.
- Bots can be a good solution for sending notifications to users. They can interact with users proactively and can be used to send messages to the user's activity feed when an update is received.
- There isn't a unified API that allows notifications in both Teams and Outlook in the same manner. Teams has an activity feed where you can post notifications, but Outlook does not have a similar feature. You might need to use different methods for each application. For Outlook, you could consider using actionable messages or email notifications.
- For connecting to an external service via REST and registering for push updates, you'll need to handle this on the server side. The server can then use the Microsoft Graph API or Bot Framework to communicate with your Teams app and send notifications to users.
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.
- frapp32Jul 31, 2024Copper Contributor
HiPrasad_Das-MSFT ,
thank you for your response. Sorry for reacting so late, but other things became high priority.
I got back to working with the teams app and i understand that using a bot is probably the best approach here. When the user initially adds the bot, i can send and save the conversation id (or what ever ids are needed). This will allow me to proactivley message the bot via REST if i understand this correctly.
I would like to know if there is some kind of event when the user logs in that is made known to the bot? This would allow me to only register the user for push updates when he actually is using teams.
If there is no such event, i assume if i send continuous updates, they would just pile up and the user gets them once he logs in again?Finally, is there some overview as to which scope a bot is responsible for? Like, is a bot limited to a specific company/tenant or is there only one global instance of the bot that handles all interactions?
Thanks and greetings,
Florian- Prasad_Das-MSFTJul 31, 2024
Microsoft
frapp32 -
1. There isn't a specific event in Microsoft Teams that directly notifies a bot when a user logs in. However, you can use the
conversationUpdateevent to detect when a user joins a conversation or when the bot is added to a conversation. This event can be used to trigger actions such as sending a welcome message or updating user-specific data
Conversation events - Teams | Microsoft Learn
2. The scope of a bot in Microsoft Teams can vary based on its configuration. Bots can be scoped to different levels, including:- Personal Scope: The bot interacts with a single user in a one-on-one chat. This scope is useful for personal productivity tools or personal assistants.
- Team Scope: The bot interacts with all members of a specific team. This scope is suitable for team collaboration tools or project management bots.
- Group Chat Scope: The bot interacts with multiple users in a group chat. This scope is ideal for small group collaborations or discussions.
Create a bot in Microsoft Teams - Teams | Microsoft Learn
Send and receive messages with a bot - 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.
- frapp32Aug 05, 2024Copper Contributor
Hi Prasad_Das-MSFT ,
thanks for your reply.
One last point i am not very hopeful about is the integration in Outlook. You mentioned actionable messages for notifiying users. I assume those notifications are done via email always? I would like to avoid email spam if possible.
I saw that message extensions work in outlook, but is there any chance that my bot would be supported as well? The bot receives the external push updates i want to send. Is there any way that those are made visible to the user in outlook without the use of email? Some sort of toast notifications or a number indicator on my app icon?
Basically any way that informs the user when he goes back to outlook that "hey, i have 3 new updates. better click on the app icon!"?
Greetings,
Florian