Microsoft Teams incorrect conversation information data - microsoft-teams

I'm working on teams bot project and i've found an issue with the IOS devices.
When IOS user sends a message to our bot we receive correct conversation information data from Microsoft service and we can reply to a client using that information.
We have next flow:
User requests card.
User clicks on the card to open task module window.
When IOS user requests the card we receive a correct conversation information from the service:
"conversation" : {
"group" : true,
"isGroup" : true,
"conversationType" : "channel",
"tenantId" : "5df.....-....-....-....-.........656",
"id" : "19:6ff255c919a34641b7d2fb59df150ebf#thread.skype;messageid=1589553462779"
}
Next we reply to user using that conversation information with the card which contains task module button.
IOS User clicks on that button and we receive incorrect conversation information data from service:
"conversation" : {
"group" : false,
"isGroup" : false,
"tenantId" : "5df.....-....-....-....-.........656",
"id" : "29:16qvJAfN2glqz_YAypLR2db_gjXvdZwtM-Au5-Gnd7y-GgLV0jVR8xyYcT6COQHcvMnjLDE6wQmlNRaUnW-x_iQ"
}
We performed all actions above in the same channel but we received different channel information. Also with that incorrect channel information we can't reply to a user.
As you can see:
"group": false # is incorrect
"isGroup" : false . # is incorrect
"tenantId" : "5df.....-....-....-....-.........656" # is correct, the same value
"id" : "29:16qvJAfN2glqz_YAypLR2db_gjXvdZwtM-Au5-Gnd7y-GgLV0jVR8xyYcT6COQHcvMnjLDE6wQmlNRaUnW-x_iQ" . # is incorrect
looks inconsistent. Other platforms are working fine (android, desktop, browser).
Bot was built on java and we use these libs:
com.microsoft.bot:bot-connector:4.6.0
com.microsoft.bot:bot-integration-core:4.6.0
com.microsoft.bot:bot-schema:4.6.0
com.microsoft.bot:bot-builder:4.6.0
From this source:
https://github.com/microsoft/botbuilder-java

unfortunately this is a bug with task/fetch button actions sent by a bot, in the current version of the iOS Teams app. We have a fix ready, and it will be available with the next release.

Related

Teams Toolkit HelloWorld chat bot - Failed to send

I’ve just downloaded Teams Toolkit onto VSCode and used the plugin to create a Command Bot project. Completed all the prerequisites and configurations on my tenant (I’m the admin for our 365 business account)
Everything installs great.
I hit f5 to launch the debugger.
All prerequisite checks pass.
Chrome opens
I can [Add] my local debug bot into the web app version of teams
I go to send any message OR the helloWorld command that comes with the template app and it gives me “Failed to send message” error.
When I hit F12 to bring up the Chrome dev tools and go into the network tab to see the call that is being sent, I see and Error as the response payload: errorCode 201 errorSubCode 1 with the message “One or more of the user ids provided are not valid."
Payload:
{
"members": [
{
"id": "8:orgid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"role": "Admin"
},
{
"id": "28:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"role": "Admin"
}
],
"properties": {
"threadType": "chat",
"chatFilesIndexId": "2",
"uniquerosterthread": "true",
"fixedRoster": "true"
}
}
Response
{
"errorCode": 201,
"message": "One or more of the user ids provided are not valid.",
"standardizedError": {
"errorCode": 201,
"errorSubCode": 1,
"errorDescription": "One or more of the user ids provided are not valid."
}
}
I haven’t written any custom code or made any changes. Just trying to launch the bot straight from Toolkit creation.
I've also tested the ngrok session that is connected to make sure that communication back to me is working fine. I see logging when I try to hit the ngrok url so I feel this is a failure at the point of Teams trying to send to their API.
I’ve followed all the steps in the documentation regarding setup. I would appreciate any help anyone would have on this.
Thank you
This is probably caused by incorrectly bot identity used in Teams channel registration in Bot Framework. Not quite sure what happen when calling the bot framework service to do the bot registration herre.
You can check if your App ID and password is correctly in Bot Framework registration:
The bot credentials in .fx configs:
The app password can be decrypted from local.userdata
To resolve this, could you please try one of the following solutions:
Create a new Command Bot and run F5 again.
Or, you can delete the local.userdata and state.local.json files in your current project. And then re-run F5, the toolkit should create a new AAD app for your bot registration in this case.

Xamarin android push notification OnMessageReceived() event is not calling when app is on background or killed mode

I have a xamarin forms application and I implemented push notification on it. I want to navigate to different pages when user taps on the push notification depends on the notification data. So for that doing some codes in OnMessageReceived event and it's working as expected if app is open mode. But this event is not triggering on other modes, please help me on this.
I refer this link to implement push notification ,pushnotification on xamarin forms.
Here is my json payload for android.
{
"notification":
{ "title" : "Sample App", "body" : "New items are available"},
"data" :
{"Id" : "876df123", "pageName" : "ClothingsPage" }
}
At first, there was an existed issue on the github which is about Xamarin.Forms Android Pushnotification FCM OnMessageReceived not fired when app is background. And the comment in it explains the cause.
In addition, there is an open issue about the push notification when app is closed. And you can try the accepted answer in this case which is about the FCM messages unable to be handled when app is killed.
Generally speaking, it seems the cause is the limit of the push notification in the xamarin's android platform. You can check the official document about the firebase message service.
Changed the notification payload to the below format, after that it worked.
{"data" : {"Id" : "123456", "body" : " test mobile app", "title" :  "SampleTest" } }

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

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?

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

No push notifications on Android via PubNub/Parse

I am stumped here. A Phonegap/Mobile Dev newbie here. Looking for some advice.
I have a phonegap app(with push plugin) developed for both Android and iOS. I was trying to test push notifications on Android. I have the following flow
Device registers with GCM(or APNS) and sends the token back to server.
On Server side I determine the identity of the user and create a channel for them on PubNub.
Server registers the device with PubNub along with the channels.
I can verify that the device has been subscribed to a few channels.
I send a message from server side.
I see it in the PubNub console.
But no notification on Android.
When I try to use one of the free services(found some php code on fiddle) available to try sending messages to the device, it works. I see notifications on the device.
I tried sending messages directly from the PubNub console with no luck.
{
"pn_apns": {
"aps" : {
"alert": "Game update 49ers touchdown",
"badge": 2
},
"teams" : ["49ers", "raiders"],
"score" : [7, 0]
},
"pn_gcm": {
"data" : {
"summary": "Game update 49ers touchdown",
"teams" : ["49ers", "raiders"],
"score" : [7, 0],
"lastplay" : "5yd run up the middle"
}
},
"full_game" : {
"date" : "2014.05.20",
"background" : "Data that is not pertinent to devices"
},"pn_debug": true
}
Note 1 - I have already added the GCM API key on PubNub.
Note 2 - I am using the free tier
So, I figured, maybe something wrong with PubNub and I move to Parse.
I create channels, register device and send messages all via curl(REST). I see push notifications on parse dashboard but still no messages on the device.
I haven't tested on iOS yet(working on some other iOS related issues).
I have followed the tutorials to the line for both PubNub and Parse. At this point, I am wondering if the device themselves need to subscribe to PubNub/Parse and a backend service cannot be used to subscribe them.
Please help.

Resources