messenger

IPC的6种方式

孤人 提交于 2019-11-29 22:24:40
IPC是Inter-Process Communication的缩写,意为进程间通信或者跨进程通信,是指两个进程进行数据交换的过程。下面就介绍一下IPC 的几种方式: 1.Bundle 这种方式使用的是比较多的,也是很常见的。四大组件中的三大组件(Activity,BroadcaseReceiver,Service)都是支持在Intent中传递Bundle数据的,由于Bundle实现了Parcelable接口,所以可以很方便的在不同进程间传输。这里就不再赘述了。 2.使用文件共享 共享文件也是一种不错的进程间通信方式,两个进程通过读/写同一个文件来交换数据。这里也不再赘述。但有一点要注意:android系统是基于Linux的,使得其并发读/写文件可以没限制地进行,甚至两线程同时对同一文件进行写操作都是允许的,尽管这可能出问题。So,重点: 文件共享方式适合在对数据同步要求不高的进程间进行通信,并且要妥善处理并发读/写问题。 3.Messenger Messenger译为信使,顾名思义,主要作用就是传递消息。通过它可在不同进程中传递Message对象,在Message中放入要传递的数据,即可轻松地实现数据的进程间传递了。Messenger是一种轻量级的IPC方案,底层实现是AIDL。Messenger的使用方法很简单,他对AIDL做了封装,使得我们更简单的进行进程间通信。

Check if user has Facebook Messenger installed iOS 9

十年热恋 提交于 2019-11-29 04:35:11
Facebook has deprecated the method [FBSDKMessengerSharer messengerPlatformCapabilities] that is used to check if the user has Messenger app installed. In the warning message, it says: messengerPlatformCapabilities is deprecated: This is deprecated as of iOS 9. If you use this, you must configure your plist as described in https://developers.facebook.com/docs/ios/ios9 I would like to remove this method, but haven't found any other option to replace this code (that makes a button disabled if user hasn't Messenger app installed): if (![FBSDKMessengerSharer messengerPlatformCapabilities]) { [self

How to send location from Facebook messenger platform?

≡放荡痞女 提交于 2019-11-28 21:35:36
There is a way to send my location to facebook-messenger from a mobile client, but how can I send some location from a bot? (messenger platform api) When I try to send a similar structure from bot, I get an error: (#100) Unsupported attachment type Is there a way to send my location from bot? Example of received message to bot: { "object": "page", "entry": [{ "id": "1719442148306048", "time": 1466780344978, "messaging": [{ "sender": {"id": "123456789"}, "recipient": {"id": "987654321"}, "timestamp": 1466780344847, "message": { "mid": "mid.12345698875:c80066d69b6cee1779", "seq": 65,

LUIS conflict with Messenger's Location quick reply

一曲冷凌霜 提交于 2019-11-28 10:44:06
问题 How can I fix this LUIS producing an error when receiving a location from a user. Right now I am putting the messenger quick reply in a attachment-prompt. Is the result from the user location an attachment? What is it? Because otherwise my attachment-prompt will do re-prompt loop. Messenger location quick reply: Result: This is the exception: System.ArgumentNullException: Value cannot be null. Parameter name: utterance at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.d*23.MoveNext() --- End of

Check if user has Facebook Messenger installed iOS 9

非 Y 不嫁゛ 提交于 2019-11-27 18:49:34
问题 Facebook has deprecated the method [FBSDKMessengerSharer messengerPlatformCapabilities] that is used to check if the user has Messenger app installed. In the warning message, it says: messengerPlatformCapabilities is deprecated: This is deprecated as of iOS 9. If you use this, you must configure your plist as described in https://developers.facebook.com/docs/ios/ios9 I would like to remove this method, but haven't found any other option to replace this code (that makes a button disabled if

How to send location from Facebook messenger platform?

夙愿已清 提交于 2019-11-27 14:00:00
问题 There is a way to send my location to facebook-messenger from a mobile client, but how can I send some location from a bot? (messenger platform api) When I try to send a similar structure from bot, I get an error: (#100) Unsupported attachment type Is there a way to send my location from bot? Example of received message to bot: { "object": "page", "entry": [{ "id": "1719442148306048", "time": 1466780344978, "messaging": [{ "sender": {"id": "123456789"}, "recipient": {"id": "987654321"},

Botframework V4: Messenger location, phone and email quick reply

青春壹個敷衍的年華 提交于 2019-11-27 08:48:47
问题 Hello i have this code on that sends a quick reply with location to the user. I put it in a text prompt to wait for user input. But its producing an error on messenger after the user sends it location. i tried text and attachment prompt but it is not working. 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(