Location Button (Messenger) - Making sending your location easy :)

(Salem Jafar Ababneh) #24

Where can I find a token? I just don’t get the idea of tokens.

(Daniel Beckett) #25

@Salem_Jafar_Ababneh

The original post is a bit outdated now since there’s an easier method available that doesn’t require a token. :slight_smile:

If you use the Make a Custom Request service you can use the following code:

 {
    "text":"Please share your location:",
    "quick_replies":[
      {
        "content_type":"location"
      }
    ]
  }
1 Like
(Imad Jundi) #26

Hi Salem

I used the following code

 {
    "text":"Please share your location:",
    "quick_replies":[
      {
        "content_type":"location"
      }
    ]
  }

and setting the method to sendMessage for telegram

it is only showing the text Please share your location and move to on.
it is not showing a button to select the location.

(Karen Barker) #27

Hi Imad,

The code in this thread will only work for Facebook messenger. If you want to do this on Telegram then you’ll need to update the custom request as follows:

{
	"chat_id": "{{bot_new_message.channel_id}}",
	"text": "Hello World",
	"reply_markup": {
		"keyboard": [
			[{
				"text": "Send Location",
				"request_location": true
			}]
		]
	}
}

You’ll also need to send some Metadata of Method = sendMessage.

Hope this helps. :thumbsup:

(Imad Jundi) #28

Agree with @kcfl
Ask for location will be a great solution.

(Imad Jundi) #29

Hi @KarenBarker
thank you, this helped me setup the button for asking for location in telegram but i faced the following issues.
I’m not given any chance to press the button, it disappear immediately and the ‘New File’ trigger is not started.
i tried to insert ‘Wait for a while’ for one minute after the request for location, now i can press the button and the ‘New File’ trigger is started.
but for sure, this is not practical, what am i missing here?

(Karen Barker) #30

Hi Imad,

The only way to allow the flow to wait for the user to press the button is to end the first flow at this point. Create a 2nd flow with the New File Trigger, and then continue with the further required actions in this flow once the user has sent their location. :thumbsup:

(Imad Jundi) #31

Hi Karen,
It is working now. i will try to ask for the location at the end of the first flow.
as Dan explained for me, i need to save all previous fields as attributes so they can be used with the second flow.
this will double the interactions counter but it’s not a problem for now.
we will be waiting for ‘Ask for location’ action.

thank you again.

(Kurt Anderson) #32

Daniel,

Will the user submitting their location via this button trigger the Find Location template flow to trigger, similarly to if the user had submitted their location using the native messenger send location feature?

(Daniel Beckett) #33

@anderkd

Yeah, the custom request should trigger the new file trigger when used.

(Anish Duggal) #34

Does Anyone have a flow they can share that will do this.

I’m trying to get users location and then open a google map in a webview that will give them directions to where we are.

Thanks

Anish

(Anish Duggal) #35

Sorry I just saw the Location flow in the new flows area. Not sure how long that has been there or how long i’ve been blind. :slight_smile:

I hope that will take care of it.

(Jade Neve Blows) #36

Hey Anish

I’m kinda faced with the same problem could you perhaps show me what you did to get the users manual input to work please?

(Daniel Beckett) #37

Hi @Jade-Neve_Blows

I can see that you’ve also emailed in to the support desk for help with this. I’ve responded over there :slight_smile:

(Andrew Catchpole) #38

To Flowxo users need Location
re Facebook Access Tokens.

This took me a little while to workout and then I found this API explore which creates the Access Tokens
https://developers.facebook.com/tools/explorer

Could someone from Flowxo kindly confirm this is an apprpriate tool and that the permissions are correct? At the moment I still get errors :frowning:
@DanielBeckett

(Andrew Catchpole) #39

@DanielBeckett - any suggestions?

Status Code 400

Body
{“error”:{“message”:“Unsupported post request. Object with ID ‘me’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",“type”:“GraphMethodException”,“code”:100,“error_subcode”:33,“fbtrace_id”:"ADFMosIr52bZ_WlI6nSDmdT”}}
Data
{
“error”: {
“message”: “Unsupported post request. Object with ID ‘me’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api”,
“type”: “GraphMethodException”,
“code”: 100,
“error_subcode”: 33,
“fbtrace_id”: “ADFMosIr52bZ_WlI6nSDmdT”
}
}

(Andrew Catchpole) #40

ps - additional comma has been removed and JSON is now showning as valid.
Unfortuately still getting an error

Status Code 400
Body
{“error”:{“message”:“Unsupported post request. Object with ID ‘me’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",“type”:“GraphMethodException”,“code”:100,“error_subcode”:33,“fbtrace_id”:"AodWNyqYq21B6hf5HVZThsL”}}

{
“recipient”:{
“id”:"{{install.user_id}}"
},
“message”:{
“text”:“Please share your location:”,
“quick_replies”:[
{
“content_type”:“location”
}
]
}}

(Nathan Stults) #41

Andrew, please see here:
https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies/#locations

Location quick replies are no longer part of the Facebook platform.

(Andrew Catchpole) #42

Okay got the Facebook briefing. It is a little frustrating to lose this feature. Now have to prompt the user with a simple screen shot.