justInTimeInstall for a Messaging Extension app not working on mobile (iOS/Android) Teams client - botframework

Working on a Messaging Extension app for Teams that opens a Task Module in a Teams Meeting. This app is installed from the "Built for your org" section of the Teams store after being loaded into a Tenant by a Teams Admin. Any tenant user who has the app installed can select the messaging extension from the … menu in a Teams Meeting to initialize the Task Module.
Before initializing the Task Module, the app's bot must be added to the meeting chat so an "Add app" button is presented after selecting the messaging extension. This button sends through a payload with the justInTimeInstall value set to true. When a new Teams user who has never used the messaging extension before tries to tap on this Add app button on a mobile device, the button either does nothing and the user is returned to the chat (iOS) or an error page with a retry button is presented and the retry button keeps presenting the same error page (Android).
When examining a network trace of this button press, a 502 code is being returned with the following JSON:
{
"errorCode": 1008,
"message": "<BotError>Bot returned unsuccessful status code Forbidden",
"standardizedError": {
"errorCode": 1008,
"errorSubCode": 1,
"errorDescription": "<BotError>Bot returned unsuccessful status code Forbidden"
}
}
This combined with some other logging makes it seem like the response isn't even getting to the app's server. This is only a problem on mobile for a Teams user who hasn't used this messaging extension app. If the same user adds the app to the meeting from desktop/web, then they can come back on mobile and the "add app" button will work in any meeting from that point forward.
Is this a known issue or is there something that I might be missing here that's preventing the app from being added for new users on mobile?

Related

Teams freezes when user clicks on "task/invoke" button

We have a published app in the Teams App Store.
Our app supports task module.
It worked just fine but about a month ago we started to receive reports from our costumers that when they are trying to open a task module, teams app just freezes.
This is how i understand task module requests work, in 4 steps:
1. User clicks on the button with data {"msteams": {"type": "task/fetch"}}`,
2. Teams sends request with this data to the bot.
3. Bot handles the data.
4. Bot replies with the appropriate url to render.
So we tested what happens when we click on the task/fetch button.
First of all we saw an error in the teams console:
TaskModuleLaunchService: launchTaskModuleByInvoke failed: "could not find app definition for app 00000000-0000-0000-0000-000000000000" where *00000000-0000-0000-0000-000000000000* is out appID.
And we don't receive any requests from the teams on the bot's side. So basically we have an issue on the step #1.
Unfortunately, we couldn't reproduce this on our devices, using the same card with the exact same button.
How can we fix this? Any help would be appreciated.
Thanks in advance.

Navigate User from slack channel to app home tab

I am working on a slack app that can be installed in any channel. It is possible or is there any slack method that allows you to open the slack app home tab from the channel. I mean a method that can navigate the user from the channel to the slack app home-tab
Send a slack message to users with #appname. For example "Click here to open the #ACME Dashboard" (assuming "ACME Dashboard" is the name of your app). #ACME Dashboard will turn into a clickable link that jumps to the app home page. It'll also add the app for users that haven't already added the app.
At least, this worked for me in limited testing with myself and one other person, so I hope it works for you. I haven't tried to figure it out, but I'm sure there's a way to send the '#app name' as part of a message from the API.

MS Teams & Bot Framework: Action buttons seems to be not working on adaptive card, sent to cross org tenant from messaging extesnion

Basically, we have a search messaging extension in our application. We can send adaptive cards from the searched results of messaging extension. This adaptive card has the action button to open the task module with a bit more information or an appropriate message suggesting the next steps to follow.
Please consider the behavior of the action button clicked when
The user who receives this card is from the same tenant
The user is being presented with a task module fetched through our bot.
The user who receives this card is from the other tenant
Our bot does not receive any events although this tenant already has our bot installed.
Try to understand why the action button in #2 is not firing event to our bot? Is there any way to handle the action button clicked event for a cross tenant?

MS Teams Messaging Extension submitTask failing with "v3 agent not found" error

I'm creating my first Microsoft Teams extension. For now I'm just trying to get the basic plumbing for a messaging extension working. I'm trying to build an extension which will allow a user to search for content in my service and then return a card into their compose window in personal and Teams chats.
I've tried to follow the basic guide ( https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/create-messaging-extension ) for creating a messaging extension using App Studio. I've setup a bot as it describes, and I have built a dummy echobot endpoint for the bot (using Ruby). I am able to "chat" with my bot directly in the Teams client and it is able to respond.
My messaging extension defines an action based command with a taskInfo with a web view URL to render and a fetchTask set to false. I've written a basic static HTML page for this and included the teams-js library. The web view loads and the teams-js library initialization callback is called. I have a submit button which calls microsoftTeams.tasks.submitTask which as I understand it, should be calling my bot with a "composeExtension/submitAction" message to which I would respond with the card. (Based on https://learn.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/action-commands/respond-to-task-module-submit?tabs=json )
I've tried installing my extension in Teams through the "Upload a custom app" option both as a "for me and my teams" and "for " but still have the following issues.
When I open my extension in the Teams client from the compose area and click this submit button in my iframe content, the submit I get a "Unable to reach app. Please try again" error displayed. In the dev console, I can see that the response to the "invoke" http post is {"errorCode":404,"message":"V3 agent not found."}
No traffic is actually sent to my bot during any of this process.
I saw this older post - Compose extension is throwing error : V3 agent not found . The https://dev.botframework.com/bots/ it refers to seems to be outdated, but in the Azure "Bot Channels Registration" console, I have gone to Channels and added "Microsoft Teams" (which I believe is the new equivalent).
Has anyone seen this happen and figured out what was going on? Much thanks!
Here is sample code for composeExtension/submitAction for Bot SDK V3. Make sure you pass the bot id and command text in taskInfo object.
case "composeExtension/submitAction":
string commandid = JsonConvert.DeserializeObject<Models.TaskModuleSubmitData<string>>(activityValue).commandId;
taskInfo = GetTaskInfo(commandid);
taskEnvelope = new Models.TaskEnvelope
{
Task = new Models.Task()
{
Type = Models.TaskType.Continue,
TaskInfo = taskInfo
}
};
return Request.CreateResponse(HttpStatusCode.OK, taskEnvelope);
Hilton had the right answer.
I had grabbed the Subscription ID from the Bot Channels Registration page instead of the App ID from the Azure Active Directory -> Apps Registration page and used that in the messaging extension manifest as the "botId" in the composeExtensions array. After fixing that I'm now getting messages submitted to my bot backend.

How to check credentials against botframework api

I'd like to check that my bot credentials (appId + appSecret) are ok to connect to https://api.botframework.com/bot/v1.0/messages.
I can't send a real message because i have no conversation running so I tried to post the following json message :
{ "type": "Ping"} but the response i got was
{
"error": {
"message": "Expression evaluation failed. Object reference not set to an instance of an object.",
"code": "ServiceError"
}
}
Is there any way to check if my access to the api is ok?
If you've registered your bot, you can visit the Bot Framework page, click on the My Bots menu, and select your registered bot. On your bot page, scroll down to the bottom left and there's a test box.
Also, you can use the emulator. It has a place in the upper right corner to replace the default credentials with your bot credentials. Then change the URL to where you have your bot deployed. Tip: remember to append 'api/messages' to the URL.
Download the BotFrameworkEmulator to test connectivity to your bot. It works on windows and OSX if you have mono installed. You can change the default settings that the emulator uses by typing '/settings' after running it. You will be prompted to enter your appId, appSecret and url endpoint for sending and receiving messages to/from your bot.
You can also use the directline rest api to initiate conversations and send messages to your bot

Resources