Intercom welcome msg pop ups multiple times - chat

I am integrating Intercom into my website,which pop ups a welcome message for all new users. but the problem is the message pops up again and again ,every time i call intercoms update method with user json as parameter until i refresh the window. this happens only when user is logged in first time.
Anybody knows how I can limit the welcome message to display only once for a user.

Micheál here from the support team at Intercom.
Intercom will only deliver a given message to a user once so if you see a situation where the same message is being sent multiple times, it's likely something is interfering with the cookie we create.
This most commonly happens when using a domain with a public suffix e.g. my_awesome_website.herokuapp.com or similar.
If you're still having issues please drop us a line at team#intercom.io and we can investigate further 🙂 

Related

Restcomm USSD - do not return a dialog

I have a working USSD gateway, messages between the user's device and the app are set.
But there is a particular type of message where I don't want to send any dialog back to the user. When a user puts a sim inside a phone for the first time, an automated USSD call is made - I receive it and handle it, to send a configuration SMS or such.
The thing is, then I don't want to send anything to the user - there is no need for the user to be aware of that call. I didn't succeed to do that up to now. Using type End, Unidirectional or Abort didn't change anything. The message processUnstructuredSSRequest_Response still has a string that will show on screen, needing the user to click the "OK" button.
How can I make this happen ?
Found it. It's the prearrangedEnd dialog attribute, look for it in the doc https://www.restcomm.com/docs/core/ussd/USSD_Gateway_Admin_Guide.html#_attributes

Facebook Graph API - Batch App-to-User Notifications Becoming Lost

My Facebook app will send app-to-user notifications when certain events trigger. It works flawlessly most of the time.
The exception is if TWO notifications are triggered and sent to the same user at the same time. It's an uncommon scenario but what sometimes happens is this: only one notification preview appears on the bottom left and the other notification shows in the notifications dropdown. After a few seconds pass the preview disappears yet only one notification remains in the dropdown. One notification is now lost.
My API requests are done in batch and the results show success.
Again, this only happens occasionally - which is the part that confuses me most. I am having trouble debugging the issue because I see no signs of error on my end.
My best guess is that since the batch requests are for the same user at the same time, Facebook is somehow confusing or overwriting one. It seems odd, however, that both are shown inside facebook for a brief period (one in corner preview and the other in the dropdown) and then one is lost.
Has anyone seen this before? Any ideas or suggestions on how to troubleshoot this?
Thank you!

Facebook Messenger Bot - How to disable bot and allow human to chat

so this is something I've been trying to think through for about 16 hours. I am coding with PHP / CuRl / etc - the bot works and everything is fine. My current issue is figuring out how to disable the bot and allow a human to begin chatting with the customer/sender.
Has anyone successfully, created a route for this ? I mean it's pretty hard from what I see, you'd have to disable etc etc. A lot of effort for my clients.
Thanks for any input.
Facebook has rolled out a "Handover Protocol" which is supposed to facilitate a combined human/bot Messenger implementation.
https://developers.facebook.com/docs/messenger-platform/handover-protocol
It is a little unclear what actually occurs in step 5:
Pass thread control: At some point in the conversation, a user may choose to do something like interact with a live agent. To handle this, pass thread control from the Primary Receiver to the Secondary Receiver. The Secondary Receiver will receive a messaging_handovers webhook event to notify it that is now controls the conversation.
This doesn't actually disable the bot (as the OP requested), and isn't in the control of the Page owner but rather of the user. It seems FB envisions the user typing something like 'I would like to chat with a human' triggering the bot to pass control...but it would be nice to let the page owner simply put the app in standby and handle the messages herself.
Once you recognize someone wants to speak to a human, set a flag that disables all actions of your bot to on.
Then, have your bot message you, or whoever will respond, that a user ID needs responding to. Have your bot continue to send all messages received from them back to you until you enable the bot again.
Create some sort of way for your bot to interact with you that allows you to send a message to a specific user, and a way to once again enable the bot interaction with the user.
Probably something like "sendMessage104012301230'Hi, sorry you couldn't find [etc]', and enableUser104012301230
There may be a better way, but those are some thoughts on how I'd do it
If you enable messages echo, whenever a human respond using the page, a echo post is sent, and inside entry->messaging->message there's no app_id.
You can use that information to disable bot replies for a certain period, or disable indefinitely until you enabled is with some admin command (that's how I'm doing)
I thought a solution could be to label the message as "unsolved". Another solution could be to have the bot mark the conversation as unread. Does anyone know if it is possibile to add a label to a conversation or mark as unread through API?

How can my app facilitate a message to multiple friends?

I have a facebook app that needs to allow a user to send a message to multiple friends (potentially all their friends) at once. This isn't any kind of spam, and I don't need the app to send the message incognito (behind the scenes), I just need to open a dialog with specific friends pre-populated (that the user has selected within my app in a prior step) and then send them a custom message. Is this possible? I see the api for sending a message to a single friend, and I see the API for inviting users to my app (but that's limited to some very small number of invitations per day)... what I need is a dialog that lets me send messages to as many of the user's friends as they want, but for me to control *which friends are selected... I don't want to give them control to add/remove from the friends list.
Is this possible?
No, the Send Dialog allows prefilling only a single friend, but would otherwise be the best option here if you need a custom message displayed to the recipient. You could get the user to send to several friends in a loop by prefilling this - or fire the dialog without prefilling and let the user chose who to send to - your app won't receive a callback with the recipient IDs but you could put a referrer param in the URL sent?
Failing that, the Requests dialog / 'invites' are the only thing you can prefill with multiple recipients without the expectation that your app will be shut down for spam shortly thereafter - there's no limit per day on the number of requests sent, but you don't get to set the message shown to the recipient.
In case this is helpful to anyone else, I just found this... it's a relatively new API (still in beta) that allows for (just about) exactly what I was asking for. I've tested it and it appears to work...
https://developers.facebook.com/blog/post/2012/08/31/reach-users-1-1-with-the-notifications-api/

When a Facebook user sends the Send dialog within an application, can the application track the recipients?

When users open a Send dialog (e.g. http://www.facebook.com/dialog/send?app_id=123050457758183&name=People%20Argue%20Just%20to%20Win&link=http://www.nytimes.com/2011/06/15/arts/people-argue-just-to-win-scholars-assert.html&redirect_uri=http://www.example.com/response) they can add or remove people from the To: line.
Is there a way for the application to track who was in the To: line if and when the user actually pushes Send?
No.
At least not currently...
If you look at the official documentation: https://developers.facebook.com/docs/reference/dialogs/send/ then you can see that this type of dialog does not expect a callback function as a parameter, and since there's no callback function then you have no way of knowing who and/or how many recipients were, and even if the dialog is closed/canceled/sent.
What you can do, though seems very complicated and well, a headache, is to use the outbox connection of the User object in the graph api (http://developers.facebook.com/docs/reference/api/user/).
I've never used that before, but I guess that you can (if you ask for the read_mailbox permission) check the user messages before and after the dialog, and see what changed.