messenger

How to receive the location from Messenger Location Quick reply

醉酒当歌 提交于 2019-12-11 10:26:20
问题 Hi i have this code that prompt the user for their location. I am using Botframework v4 and C#. I put the messenger quick reply in an attachment prompt. if (response == "test location") { Activity reply = stepContext.Context.Activity.CreateReply(); reply.ChannelData = JObject.FromObject( new { text = "loc", quick_replies = new object[] { new { content_type = "location", }, }, }); return await stepContext.PromptAsync( ATTACHPROMPT, new PromptOptions { Prompt = reply, }); } But after the user

Facebook PHP Messenger Bot - receive two messages

末鹿安然 提交于 2019-12-11 08:16:35
问题 I would like to write messenger bot based on this script: <?php $challenge = $_REQUEST['hub_challenge']; $verify_token = $_REQUEST['hub_verify_token']; // Set this Verify Token Value on your Facebook App if ($verify_token === 'testtoken') { echo $challenge; } $input = json_decode(file_get_contents('php://input'), true); // Get the Senders Graph ID $sender = $input['entry'][0]['messaging'][0]['sender']['id']; // Get the returned message $message = $input['entry'][0]['messaging'][0]['message'][

How to Remove “Powered by ManyChat” footer from a messenger bot

十年热恋 提交于 2019-12-11 06:35:41
问题 I am developing a chat bot for the messenger platform, but I found myself mesmerized by the fact that “ManyChat” appears on the footer of the users text input field. I have become an admin of that page and proceed to remove many chat from the list of connected apps for that page, but the footer is still there. Maybe I have to call the messenger platform API in order to change some property that isn’t available from the Facebook Pages User Interface. But nothing in the documentation mentions

Error getting user id from messenger webview even after white listing domain

青春壹個敷衍的年華 提交于 2019-12-11 06:17:42
问题 i have white listed my domain and i get a message showing it was successful {"result": "Successfuly updated whitelisted domains"} but when i try getting the user id I get the error message An error occuredMessenger Extensions are not enabled - could be "messenger_extensions" was not set on a url, the domain was not whitelisted or this is an outdated version of Messenger client i am using A PC so an outdated version might not be it, and i have the messenger extension set this way $get_started

My Facebook Messenger Bot is completed, but isn't visible to be approved

徘徊边缘 提交于 2019-12-10 23:19:13
问题 We built a Facebook Messenger bot that works perfectly. The bot is only available to developers and testers and can't be made public until it's approved. We submitted it for approval but the approval person obviously didn't have access to the bot because they typed in the commands and got no reply (which is expected if they're not a developer or tester). The screenshot they showed also didn't have the "get started" at the beginning, which is another clue that they didn't have access) How do I

Send a message from View to ViewModel : what is an appropriate token?

ⅰ亾dé卋堺 提交于 2019-12-10 10:08:44
问题 Lets define : a viewModel : the TabViewModel class a view : the TabView class I have n instances of the TabView class, and so n instances of TabViewModel . When one instance of the TabView class send a message, I want it to be received by its own viewmodel, and only this one . As I understand the Messenger of the mvvm light toolkit, I whould use something like : // in the view Messenger.Default.Send(new RefreshMessage(/*...*/), oneToken); and // in the viewmodel Messenger.Default.Register

Android进程间通讯之messenger

断了今生、忘了曾经 提交于 2019-12-09 18:14:58
平时一说进程间通讯,大家都会想到 AIDL ,其实 messenger 和 AIDL 作用一样,都可以进行进程间通讯。它是基于消息的进程间通信,就像子线程和 UI 线程发送消息那样,是不是很简单,还不用去写 AIDL 文件,是不是有点小爽。哈哈。 此外,还支持记录客户端对象的 Messenger ,然后可以实现一对多的通信;甚至作为一个转接处,任意两个进程都能通过服务端进行通信。 与 AIDL 比较:   当您需要执行 IPC 时,为您的接口使用 Messenger 要比使用 AIDL 实现更加简单,因为 Messenger 会将所有服务调用排入队列,而纯粹的 AIDL 接口会同时向服务发送多个请求,服务随后必须应对多线程处理。   对于大多数应用,服务不需要执行多线程处理,因此使用 Messenger 可让服务一次处理一个调用。如果您的服务必须执行多线程处理,则应使用 AIDL 来定义接口。 接下来看下怎么写: 服务端: 1. 创建一个 handler 对象,并实现 hanlemessage 方法,用于接收来自客户端的消息,并作处理 2. 创建一个 messenger( 送信人 ), 封装 handler 3.messenger 创建一个 IBinder 对象,通过 onBind 返回给客户端 客户端: 1. 在 activity 中绑定服务 2. 创建

How to open facebook messenger chat window using app-scoped id in android

◇◆丶佛笑我妖孽 提交于 2019-12-09 06:58:39
问题 I can get a app-scoped user id with graph-api in my application. Then, how to open facebook messenger chat window using app-scoped id in android. We can open facebook messenger chat window using global-facebook-id(using intent and uri). Uri uri = Uri.parse("fb-messenger://user/"); uri = ContentUris.withAppendedId(uri, Long.parseLong(peopleId)); Intent intent = new Intent(Intent.ACTION_VIEW, uri); startActivity(intent); But, it is not possible to get global-facebook-id using app-scoped-id.

[翻译]Android Bound Services

[亡魂溺海] 提交于 2019-12-07 16:17:59
一个bound service是一个client-server接口中的server端。一个bound service允许应用组件(比如activities)bind到它,发送请求,接收响应,甚至是执行进程间通信(IPC)。一个bound service在典型情况下,只有在它服务于另一个应用组件时才存活,而不是在后台无限期的运行。 这份文档向您说明了要如何创建bound service,包括在其他的应用组件中如何bind到service。然而,你也应该参考Services文档来 大体地 了解关于services的额外信息,比如如何在service中传送通知,设置service在前台运行,等等。 基本概念 一个bound service是一个 Service 类的实现,它允许其它应用bind到它并与它交互。为了给一个service提供binding功能,你必须实现 onBind() 回调方法。这个方法返回一个 IBinder 对象,该对象则定义了客户端可以用来与service进行交互的编程接口。 Binding到一个Started Service 如同在 Services 文档中讨论的那样,你可以创建一个service,既可以被started,也可以被bound。即,service可以通过调用 startService() 被started,从而允许service无限期的运行

Android Messenger 跨进程通信

馋奶兔 提交于 2019-12-07 02:49:14
如果你需要在不同进程间通信,你可以在Service中使用Messenger来实现进程中通信。 如果使用这种方式,Service中需要定义一个Handler对象(负责对客户端发送过来的Message进行响应)。 Messenger可以共享给client一个IBinder对象,client通过这个IBinder对象向Service发送Message,而前面提到的Handler对象是这一切的基础。 注:使用这种方式进行通信是不支持多线程的。 那就让我们来看看使用这种方式进行通信吧! 注:Service在声明时必须对外开放,即android:exported="true",且本文是通过Intent启动的Service,所以在声明时该Service可以接收特定的Action。 1、在Service中创建一个Handler对象,来处理从client发过来的Message 2、根据创建的Handler对象创建一个Messenger对象 3、使用Messenger的getBinder方法得到一个IBinder对象,并在Service的onBind方法中将其反出去 4、client在onServiceConnected中根据IBinder参数创建一个Messenger对象(可参考Messenger的构造函数) 5