I want to display a welcome message whenever someone connects to my bot. I\'ve used the technique from the demo-ContosoFlowers sample on github (https://github.com/Microsoft/Bot
Create a class and have this in you callback url of fb. FacebookProfile is my class that holds the name and other information after the call.
public static async Task<FacebookProfile> GetFacebookProfile(string accessToken)
{
var uri = GetUri("https://graph.facebook.com/v2.6/me",
Tuple.Create("fields", "name,email,id,first_name,last_name"),
Tuple.Create("access_token", accessToken));
var res = await FacebookRequest<FacebookProfile>(uri);
return res;
}
I also tried out the ContosoFlowers demo today. I experienced the same behavior you describe: in the emulator, ConversationUpdate code is triggered but in Skype it is not. However, I did notice that the ContactRelationUpdate activity type does fire in Skype (I haven't tried Facebook Messenger). If your goal is to display a welcome message whenever someone "connects" to your bot, you could try using the ContactRelationUpdate activity type like this:
else if (message.Type == ActivityTypes.ContactRelationUpdate)
{
if(message.Action == "add")
{
var reply = message.CreateReply("WELCOME!!!");
ConnectorClient connector = new ConnectorClient(new Uri(message.ServiceUrl));
await connector.Conversations.ReplyToActivityAsync(reply);
}
}