how to respond an error to payments_get_items method in the credit callback - facebook

Anybody know how to respond an error to the payments_get_items method?
for the payments_status_update method we can send a "canceled" status, but no error message is documented (as I konw) for the payments_get_items method
For example... there is an item any user can buy, but with a limited quantity global to the game; an user UI was loaded when there are items left so he can send an order, but when I was sending back the item description I detect that there aren't any item left: I don't want to send the description now and then give a "canceled" message in the following communication
any solution?

I don't believe there's an official method - one option would be to 'hack' around their system by responding with a "fake" item which costs 0 currency and informs the player that the item is no longer available.

Related

How to properly send event parameters with Facebook Server Events

I am setting Facebook Pixel for the first time with the Conversions API and all my TestEvents are correct and I am receiving the events I am supposed to. But in every event under "Overview" I have this error:
No event parameters were detected. Use Test events to view the parameters of an individual event trigger.
I am new to this so I don't even know if this is an error or if it should work like that.
I am having a similar problem.
I am sending Custom Events. The Pixel and Server events are successfully deduplicating. Custom parameters are within both tags, however while the custom parameters are successfully being sent (& are hence visible in Events Manager Test Events) by the Pixel tags, the custom parameters are missing when viewing the Server Events in Test Events.
I have used both Custom HTML tags originally, and now the Facebook tag template, but and have endlessly tweaked the settings, but just cannot resolve this.
Let me know if you made progress!
Here are some good links that may help you
https://www.simoahava.com/analytics/facebook-conversions-api-gtm-server-side-tagging/
https://www.simoahava.com/custom-templates/facebook-pixel/
https://www.optimizesmart.com/gtm-server-side-tagging-for-facebook/

Can’t Override Default Cancel Intent

Is there anyway that I can add a custom message when user says ‘Cancel’ or ‘Exit’ to end the conversation?
I have added intent for these utterances and connected it with my webhook but the message I send back in app.ask() is not displayed or read.
This is currently a known issue and you cannot override these words currently. You can handle handle other words like "quit", "finish", "exit", etc.
Done using API.AI. (see the picture)
http://i.imgur.com/WDQWmwb.png
As per this specification
Conversation Exit google assistant
probably you will only able to do an app.tell() in your webhoook because this must be a final Intent (you can tell something to user but not ask and waiting for a response), see point five of suggested configuration:
Enable Set this intent as end of conversation
In every case if you use a weebhhok take care: The maximum execution time allowed for conversation exit requests is 2 seconds

IOS Chat App unread Messages in UITableview cell

I have a Query related to Chat Application like Whatsapp. How to Calculate total number of Unread messages by friends in chat app like whatsapp. if we want to calculate all unread messages and show on a badge in current chat window only?
Without knowing how you model the conversations or without any code provided by you it's difficult to give you an exact answer but let's imagine a possible way to model it assuming you still haven't implemented nothing.
You could use a Message object class (or struct if using swift) to hold each conversation entry which could hold among other properties: message text, the User object owing the message, other relevant info etc and a property to determine if it was read (e.g. isRead Boolean property or an enum type .read .unread).
A Conversation object could be a List (an Array) of Message objects and if you want to know how many messages on a conversation are unread (to update UI, badge or whatever other UI widget you need to update) it would be a matter of filtering a given Conversation instance and counting the amount of Message objects inside of it that have isRead==false or whose status is .unread if you go the enum way.
This is a simplistic approach and may (or not) match your current implementation but as no code was provided by you, let's consider this an 'educated guess'.

FB Chatbot how to get the previous message

Is it possible to receive the previous message that the user have send to the chatbot (without using quick replies or postback buttons). Example:
User: "Can you call a friend?"
Bot: "Who should I call?"
User: "Tim"
In the API I now have just the information "Tim", without knowing if I should call him or text him or make him a sandwich or whatever. So I basically I want to add some Postbackdata or metadata additionally to the text "Can you call a friend" (intent: 'CALL'), so the message "Tim" will come with that data.
Is there a way without storing the data into a database? AWS Lambda with ClaudiaJs.
I found the metadata field in the FB API which turns out to be the wrong field for that since it is only for communicating between several apps?!
What you are looking for a called a "slot-based bot", or slot-filling, basically meaning that you have a "slot", or blank that needs to be filled in before your bot can perform an action. In your example you have two slots: action and person
Actions could be: call, text, message
Person: name of a person, friend, etc.
I don't think any of the message frameworks (Slack, Facebook, etc) will provide you with the information you need. You will need to build this logic out yourself.
You can look at using wit.ai stories to achieve this.
Look to this similar Stack Overflow question and answer.
You can reverse order of conversation, and at beginning user writes some text or send you something else. After receiving, you should send to user buttonsTemplate, where postbacks will be like "CallTo&Tim" where instead of Tim you can put every text you need to pass to next executor(and you also can store previous user message here). Than just make substring of postback, check it`s type and do whatever you want.

How to implement "last seen at" functionality (like whatsapp) in XMPP?

I am working on a chat application and want to add "last seen at" functionality. I am trying to implement it by using presence stanzas but getting one issue, please check at below link
Not getting unavailable presence of User A when User B is also unavailable
Is there any other way to implement last seen at functionality
please suggest
The first Google result for "xmpp last seen" is XEP-0012: Last Activity, which is a protocol extension that can be used to find out when a user was online last time.
You send a request like this:
<iq from='romeo#montague.net/orchard'
id='last1'
to='juliet#capulet.com'
type='get'>
<query xmlns='jabber:iq:last'/>
</iq>
And get a response like this:
<iq from='juliet#capulet.com'
id='last1'
to='romeo#montague.net/orchard'
type='result'>
<query xmlns='jabber:iq:last' seconds='903'/>
</iq>
Which means that the contact was last online 903 seconds ago. Subtract this from the current time to get the "last seen" timestamp.
Last seen and Last Activity are two different scenarios.
Last Activity is when user gone offline last time, but last seen is when user goes in background from the application in that case user will be available if application is not killed.You have to create new plugin on server side for last seen.
The #legoscia solution will return the last activity time, which is your last logout time(not the last time when user was online), plz check this https://github.com/processone/ejabberd/issues/2265
If the user has at least one connected or available resource when the server receives the request, the response MUST (subject to local security policies) contain an empty element whose 'seconds' attribute is set to a value of '0'.
One solution is to kill the session every time the app goes in background and reconnect when the app is in foreground