botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Facebook Messenger] Form dynamic choices bubbles not showing in Facebook Messenger but work elsewhere.

Open nayots opened this issue 9 years ago • 2 comments


System Information (Required)

  • SDK language (C#)
  • SDK version 3.5.5
  • Development environment - localhost | Azure App Service

Issue Description

Short description of the problem: I have a form that asks the user to chose from 1 or 2 options. Those options come from an integer list. It all works fine and dandy in WebChat and Emulator but the bubble buttons don't appear in facebook messenger. I use the same code for other forms and it works fine, but for some reason wont work with this one.

Also the Form Message does not show in messenger but shows in web chat and emulator.

Check the Stack OverFlow post for more details.

Link to Stack Overflow post.

Example Code

Code in PasteBin since it gets badly formatted here

[Serializable] public class RarityAndLevelForm { [Prompt("What is the {&} of your hero? {||}")] public int? Rarity; [Prompt("Chose {&} of your hero? {||}")] public StatsVariation StatsVariation;

public static IForm<RarityAndLevelForm> BuildForm()
{
    return new FormBuilder<RarityAndLevelForm>()
        .Message("Answer the questions to get your hero's IVs. Type help for additional information or quit to cancel.")
        .Field(new FieldReflector<RarityAndLevelForm>(nameof(Rarity))
                .SetType(null)
                .SetDefine((state, field) =>
                {
                    foreach (var item in GetRarities())
                    {
                        field.AddDescription(item, item.ToString() + " Stars")
                             .AddTerms(item, item.ToString() + " Stars");
                    }
                    return Task.FromResult(true);
                }))
                .AddRemainingFields()
        .Build();
}

static List<int> GetRarities()
{
    var res = HeroService.GetHeroRarities();//List of integer numbers
    return res;
}

}

Expected Behavior

I expect this to happen in messenger : https://i.stack.imgur.com/1ZBRe.png

Actual Results

But i get this: https://i.stack.imgur.com/UoHVK.png No bubble buttons and no Form Message

nayots avatar May 11 '17 23:05 nayots

Problem fixed by updating the SDK to version 3.8.0. Special tnx to Ezequiel Jadib at Stack overflow. Everything works fine now :) http://prnt.sc/f72n90

nayots avatar May 12 '17 16:05 nayots

Another thing I noticed in relation to above was, if you send a message with buttons and if you follow it with another text message, it makes the buttons disappear. For a while I thought it was a bug only to realize FB needs to sort it out :)

chitrang89 avatar May 17 '17 03:05 chitrang89