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

Facebook Account Linking event

Open matheus208 opened this issue 10 years ago • 23 comments

Is there a timeline for implementing Facebook's API Account Linking events?

I have implemented the whole control flow, but the Account Linking Callback is not sent to my application.

Alternatively, is there a way of enabling this callback through the Framework to the applications?

matheus208 avatar Jul 18 '16 20:07 matheus208

Hmmm...Looking at the code you should be receiving a message activity with { "type":"message", ... "channelData" : { "sender":{ "id":"USER_ID" }, "recipient":{ "id":"PAGE_ID" }, "timestamp":1234567890, "account_linking":{ "status":"unlinked" } } ....
}

tomlm avatar Jul 20 '16 02:07 tomlm

Okay, so I tested this with the v1 lib a couple days ago. We have just updated the code to v3, so I need to run another test.

I'm having problems sending a SigninCard to Facebook, though. I'm using this:

            const message = new builder.Message(session);
            message.attachments([
                            new builder.SigninCard(session)
                                            .button("Login", "http://localhost:9090/")
                                            .text("Logar")
            ]);

            session.send(message);

However, Facebook shows a regular card. When I click the button, it simply opens the link on another tab (instead of opening the popup with the Facebook's querystring parameters, as an "account_link" button would do). Am I missing something?

matheus208 avatar Jul 20 '16 13:07 matheus208

Well, I POSTed a request manually to show the correct card.

Even then, after the workflow from my end is done, the login is successful, I can see that "You logged in to your X account." printed in special lettering by Facebook, but nothing gets POSTed to my endpoint, so I can't act on it :(

matheus208 avatar Jul 20 '16 21:07 matheus208

Hi, @tomlm. Any advice on this? Is there anything else I should do to listen for the signin event?

matheus208 avatar Jul 21 '16 20:07 matheus208

+1 I'm in the same boat. The SigninCard doesnt appear to use the new Messenger account linking feature, therefore I'm using a sourceEvent and sending the channel data manually but no callback :(

byrner75 avatar Jul 27 '16 16:07 byrner75

Is your webhook registered for messaging_account_linking?

tomlm avatar Aug 10 '16 02:08 tomlm

Just double checked it there and message_account_linking is selected. I only tried to do account linking yesterday with botbuilder v3.2.3 and I didn't receive the callback message. One difference I did notice when compared to previous attempts was the little superscript message didnt appear in the conversation i.e. "You have been logged in....."

On 10/08/16 03:04, Tom Laird-McConnell wrote:

Is your webhook registered for messaging_account_linking?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/745#issuecomment-238746204, or mute the thread https://github.com/notifications/unsubscribe-auth/AAju4nEuuj_eJ-wwCWl_StIZjo4npfp5ks5qeTGpgaJpZM4JPIob.

byrner75 avatar Aug 10 '16 07:08 byrner75

You have to unlink it before trying to link it again. Otherwise the message won't appear. But that has nothing to do with BotBuilder, it's Facebook.

On 10 Aug 2016 04:54, "byrner75" [email protected] wrote:

Just double checked it there and message_account_linking is selected. I only tried to do account linking yesterday with botbuilder v3.2.3 and I didn't receive the callback message. One difference I did notice when compared to previous attempts was the little superscript message didnt appear in the conversation i.e. "You have been logged in....."

On 10/08/16 03:04, Tom Laird-McConnell wrote:

Is your webhook registered for messaging_account_linking?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/Microsoft/BotBuilder/issues/745# issuecomment-238746204>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAju4nEuuj_eJ-wwCWl_ StIZjo4npfp5ks5qeTGpgaJpZM4JPIob>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/BotBuilder/issues/745#issuecomment-238792345, or mute the thread https://github.com/notifications/unsubscribe-auth/ACGGJ422jOulAN9np0aHrzXUzJaed5LVks5qeYOhgaJpZM4JPIob .

matheus208 avatar Aug 10 '16 10:08 matheus208

Just did an unlink and I got the superscript message to tell me I have logged out. Now when I try linking I get and "Account Linking Failed" message in Messenger

byrner75 avatar Aug 10 '16 13:08 byrner75

The Account Linked Failed was a facebook issue which I raised with them yesterday. Its working again today however I still dont get the callback to my bot.

byrner75 avatar Aug 11 '16 13:08 byrner75

any update on this ?

somprabhsharma avatar Oct 04 '16 09:10 somprabhsharma

As you noted, it looks like we're not passing the account_linking messages through. I'll fix the code to pass them to the bot in channeldata. We should be able to get this deployed in the next couple days.

craigjensen avatar Oct 06 '16 21:10 craigjensen

The fix has been deployed. Please reopen you still see this

craigjensen avatar Oct 10 '16 23:10 craigjensen

Hi,

I am still seeing regular card on fb messenger (instead of account linking) when using signin card. I dont need to update anything to make this work right ?

Thanks

palashjhabak avatar Oct 12 '16 19:10 palashjhabak

Unfortunately, the built in signin card isn't rich enough to fully support the Facebook account linking functionality so you'll need to send your own card via channeldata. The fix above was to enable our channel to pass Facebook account_linking messages to your bot. Sorry for the confusion.

craigjensen avatar Oct 12 '16 20:10 craigjensen

I am a little more confused now. By built in signin card you mean the content-type ('application/vnd.microsoft.card.signin') and message/channel specific processing you do at your end after the message is POSTed to botframework's server by the connector right ?

By sending my own card via channel data you mean by using sourceEvent ?

palashjhabak avatar Oct 12 '16 20:10 palashjhabak

Yes - built in signin card is 'application/vnd.microsoft.card.signin'. If you are using the node sdk then you would need to send your own card via sourceEvent.

craigjensen avatar Oct 12 '16 20:10 craigjensen

Thanks for the clarification.

One more doubt, since we wouldn't know how different inbuilt content types are processed at botframework's sever, how will we know what all things are supported?

palashjhabak avatar Oct 12 '16 20:10 palashjhabak

We've heard that feedback multiple times so we're working on updating the documentation with a complete list of features that are supported by each channel. Hopefully, that will help to clarify the differences between channels.

craigjensen avatar Oct 12 '16 20:10 craigjensen

Thanks.

Was just curious, why cant built in content types be updated to support things which are common in all the channels. Like Connect/SignIn/Account Linking is present in almost all the channels, just that the message format is different, so wouldn't is make sense for card.signin to process the message accordingly and send it to the bots ?

Palash

palashjhabak avatar Oct 13 '16 07:10 palashjhabak