Microsoft Teams response to message extension with open url action - botframework

I want to be able to open url with message extension in Teams. Is it possible?
What I can do so far is to response the message extension with an adaptive card which has a openurl action button then from the adaptive card, the user can click on the button and open the url. This way they user has to click twice to just open an url with message extension.
[Example code added]
Response to "composeExtension/fetchTask" bot activity with adaptive card wrapped in attachment in the task info.
final Attachment attachment = new Attachment().withContentType("application/vnd.microsoft.card.adaptive").withContent(
cardBuilder.createAdaptiveCard());
final TaskInfo taskInfo = TaskInfo.builder()
.title("Message extension using adaptive card")
.card(attachment)
.height(TaskModuleDimension.SMALL)
.width(TaskModuleDimension.SMALL)
.build();
return new BotActivityResponse(TaskType.CONTINUE, taskInfo);
Note: I am able to return just a TaskInfo with an url which opens a popup. However, what I want is to open url in a browser out of Teams app.

Related

URL in heroCard does not open a new browser window

We have a node js based app for message extension.
For the text param of the hero card we provide an with an URL in href.
In the chat or group chat, clicking the url does not open a new browser tab.
When we do the same thing in a team post the url opens a new tab.
We want the url in the card to open a new browser tab also in a chat and a group chat.

Messageback like feature of Adaptive Card in Slack BlockKit

I am trying to implement messageBack feature of Adaptive Card in Slack Builder Kit where on clicking of a button I can show a default response of the bot before the response comes from the API. This could be implemented in Adaptive Card using messageBack. Is there a way to do similar thing in Slack Builder Kit template.
On clicking the button, I want to show 'Thank you for clicking' and then I want to show the response which comes from the API.
When the button is clicked, you can update the message that you sent with "Thank you for clicking" using the chat.update method. After that, you could update it once more to show the response from the API or just send another message via chat.postMessage.
Alternatively, you could send an ephemeral message with the text "Thank you for clicking" using the chat.postEphemeral method, which would only show up for the user that clicked the button and then send a regular message with the API contents in a later message.

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.

Send an email with xamarin essential

I use the following sample to sent a simple email.
https://learn.microsoft.com/en-us/xamarin/essentials/email?tabs=android
The first time when I run xamarin forms app and call the sent method the popup with apps for selection appeared.
I selected Viber for testing, nothing happened but now i can't undo this selection. Every time when i call the send mail the viber opened.
I tried to clear the app data from the settings and unistall-install the app again but i have the same problem.
How can i fix it ? Can i open a dialog with only email clients ?
Thanks !!
I replace Xamarin.Essential email implementation
var message = new EmailMessage
{
Subject = subject,
Body = body,
To = recipients
};
await Email.ComposeAsync(message);
with
Device.OpenUri(new Uri("mailto:test#test.com?subject=test&body=test"));
Now the dialog has only the available mail clients.

Get custom data on button click in Webchat

In Facebook messenger, buttons (on the cards as well), can send a custom payload, along with the text of the button which was clicked. This payload is available in the sourceEvent section of the message. Also this payload has to be added in the sourceEvent manually. There is no official Bot framework API available for doing this.
This is a sample payload on FB button
https://developers.facebook.com/docs/messenger-platform/send-api-reference/button-template
My Chatbot also supports Webchat. Does Webchat supports sending such payload to the bot? Right now all I get is the text of the button clicked.

Resources