Forum Discussion

RyosukeShintani's avatar
RyosukeShintani
Copper Contributor
Feb 02, 2023
Solved

Error with message extension on iOS only.

I used the message extension for Microsoft Teams to display a Hero Card in the input field.
 
Only in the case of iOS, the error seems to be caused by a different definition of the JSON sent to the BOT.
  • PC
    • reaction Type = string
  • Android
    • reaction Type = string
  • iOS
    • reaction Type = array of string 

 

The following exception occurs.

Newtonsoft.Json.JsonReaderException: 'Error reading string. Unexpected token: StartArray. Path 'messagePayload.reactions[0].reactionType'.'
 
Is there any way to work around this bug?
  • Nivedipa-MSFT's avatar
    Nivedipa-MSFT
    Sep 26, 2023
    RyosukeShintani - The bug has been fixed now. We have tested this on IOS 16.6.1 and Teams version 15.6.0.
    Could you please test this and confirm once?

8 Replies

    • RyosukeShintani's avatar
      RyosukeShintani
      Copper Contributor

      Nivedipa-MSFT 

      Sorry, I am not good at English, so I may not be able to communicate well...

       

      HeroCard is not involved.

       

      Teams for iOS Message Extension -> choiceset window[send request to azure bot] -> Azure BOT [Error occurs!!] -> return HeroCard to Teams

      The json(RequestBody) sent by Teams for iOS to the BOT in the background is wrong.

       

      The json of the messagePayload of the RequestBody is as follows.

       

      #Teams for Windows

       

      "messagePayload": {
        "attachments": [],
        "body": {
          "content": "hoge",
          "contentType": "html"  },
        "createdDateTime": "2023-02-02T02:09:25.773Z",
        "deleted": false,
        "from": {
          "user": {
            "userIdentityType": "aadUser",
            "displayName": "xxxxxxx",
            "id": "xxxxxx"    }
        },
        "id": "xxxxxxxxxx",
        "importance": "normal",
        "linkToMessage": "xxxxxxxxx",
        "locale": "ja-JP",
        "mentions": [],
        "reactions": [
          {
            "createdDateTime": "2023-02-02T02:09:44.835Z",
            "reactionType": "laugh",
            "user": {
              "user": {
                "userIdentityType": "aadUser",
                "displayName": "xxxxxx",
                "id": "xxxxxxxxx"        }
            }
          }
        ],
        "subject": ""}

       

       

      #Teams for iOS

       

      "messagePayload": {
          "body": {
              "contentType": "html",
              "content": "hoge"    },
          "id": xxxxxxxx,
          "reactions": [
              {
                  "reactionType": [
                      "laugh"            ],
                  "user": {
                      "conversation": "",
                      "device": "",
                      "application": "",
                      "user": {
                          "userIdentityType": "aadUser",
                          "id": "xxxxxxxx",
                          "displayName": "xxxxxxxx"                }
                  },
                  "createdDateTime": "2023-02-02T02:09:44.835Z"        }
          ],
          "linkToMessage": "xxxxxxxx",
          "replyToId": xxxxxxxx,
          "subject": "",
          "from": {
              "conversation": "",
              "device": "",
              "application": {},
              "user": {
                  "userIdentityType": "aadUser",
                  "id": "xxxxxxxx",
                  "displayName": "xxxxxxxx"        }
          },
          "createdDateTime": "2023-02-02T02:09:25.773Z",
          "locale": "ja-jp-jp",
          "importance": "",
          "summary": null,
          "deleted": "false",
          "mentions": [],
          "attachments": [],
          "lastModifiedDateTime": ""}

       

       Only when message extensions are used for messages that have reactions in iOS, reactionType is array of string.

      • Nivedipa-MSFT's avatar
        Nivedipa-MSFT
        Icon for Microsoft rankMicrosoft
        RyosukeShintani - We tested this in Teams desktop and IOS. In Teams desktop client we are getting reaction type as String. In IOS getting reaction type as array. and getting 501 Not Implemented error.
        We have raised a bug for the same. We will let you know once we get any updates on it.

Resources