You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently this package ignores the request, but I'd like to be able to handle it in my application. I traced it back to the FacebookMessenger.Response.parse function, and it just looks like it has no structure specified for this specific webhook. What would be the best way to add this?
I could pattern match with a new parse function like...
But that looks pretty hideous. It would be nice to keep the same parse function and just add to the structure.
Thoughts? What is the best way to go about supporting account linking webhooks? I would be happy to work on a PR for this as I'm using it for a project at the moment
The text was updated successfully, but these errors were encountered:
Would an account_linking key in the messaging struct be appropriate? This will contain a map like %{"authorization_code" => "12341234", "status" => "linked"} and will be nil for regular messages
Account linking is something new as far as I see. Would be nice to have support parsing of this type of payload.
Also we need to rethink how to make design of internal structs more flexible. Can you elaborate?
The first thing that would need doing is adding the concept of buttons here, as facebook requires account linking requests to be initiated through a specific "log in" button.
Then we'll need a way to handle facebooks callbacks for a user connecting/disconnecting their account with the bot. I think something similar to the message_received that can be added to the controller in your project, like a account_linking_received call that will allow you to take the information from facebooks callback, and do the linking with the account in your project.
Hope this makes sense, I'm fairly new to Elixir but I'm using this for a bot and I've hacked together both features for now, but I'd be keep to get better support for them, especially buttons.
When using account linking, Facebook sends a response like this (with a little variation between linking an account and unlinking one)
Currently this package ignores the request, but I'd like to be able to handle it in my application. I traced it back to the
FacebookMessenger.Response.parse
function, and it just looks like it has no structure specified for this specific webhook. What would be the best way to add this?I could pattern match with a new parse function like...
def parse( %{"entry" => [%{"messaging" => [%{"account_linking" => _}]}]} = param ) when is_map(param)
But that looks pretty hideous. It would be nice to keep the same parse function and just add to the structure.
Thoughts? What is the best way to go about supporting account linking webhooks? I would be happy to work on a PR for this as I'm using it for a project at the moment
The text was updated successfully, but these errors were encountered: