Facebook gifting send plural form of object type in Unity3d - facebook

I am sending apprequest to send "Gift" to friends.
Code which i am using to send gift is as below :
FB.AppRequest (Send_Gift_Message, OGActionType.SEND, GIFT_10_COINS, toFriends, null, "Send Gift", delegate(IAppRequestResult result) {
});
This is sending gift request perfectly but i just want to change message which is shown while sending gift.
I am attaching image which shows message :
I want to change "sent you a coin:". I want to use "sent you coins:".
Is it possible to change ?
If it is possible then plaese guide me steps.
Thanks.

Related

Facebook Messenger Sender Actions

I am trying to use Sender Actions as described in the messenger Send API docs. However when I send a typing_on POST I do no see anything happen in messenger. I have tried on chrome desktop and the messenger android app.
I am able to send a mark_seen POST and this does update the chat with an icon indicating my message has been seen.
The request body looks as follows:-
{
"recipient":{
"id":"<PSID>"
},
"sender_action":"typing_on"
}
When sending mark_seen, typing_on or typing_off I always get the following response body.
{
"recipient_id": "<PSID>"
}
Are there additional steps needed to get the typing indicator to display? Does it only work on a specific platform? I cannot find any more documentation, and I am not getting any error messages, the POST status comes back OK identically when sending mark_seen or typing_on, I just can't see any effect after typing_on.
Okay I got reply from Facebook developer team on Facebook Developers group
Quote:
"This changed recently for mobile and is currently assigned to an internal team". Looks like something internal.

How can I send a message to someone with my telegram bot using their Username

I am using the telepot python library, I know that you can send a message when you have someone's UserID(Which is a number).
I wanna know if it is possible to send a message to someone without having their UserID but only with their username(The one which starts with '#'), Also if there is a way to convert a username to a UserID.
Post one message from User to the Bot.
Open https://api.telegram.org/bot<Bot_token>/getUpdates page.
Find this message and navigate to the result->message->chat->id key.
Use this ID as the [chat_id] parameter to send personal messages to the User.
It is only possible to send messages to users whom have already used /start on your bot. When they start your bot, you can find update.message.from.user_id straight from the message they sent /start with, and you can find update.message.from.username using the same method.
In order to send a message to "#Username", you will need them to start your bot, and then store the username with the user_id. Then, you can input the username to find the correct user_id each time you want to send them a message.
You can't send message to users using their username that is in form of #username, you can just send messages to channel usernames which your bot is administrator of it. Telegram bot api uses chat_id identifier for sending messages. If you want to achieve chat_id of users, you can use telegram-cli, but it's not easy at all because that project is discontinued and you should debug it yourself.
in your case you should do following command:
> resolve_username vahid_mas
and the output will be something like this:
{
"user": {
"username": "Vahid_Mas",
"id": "$010000006459670b02c0c7fd66d44708",
"last_name": "",
"peer_type": "user",
"print_name": "Vahid",
"flags": 720897,
"peer_id": 191322468,
"first_name": "Vahid",
"phone": "xxxxxxx"
},
"online": false,
"event": "online-status",
"state": -1,
"when": "2017-01-22 17:43:16"
}
As the user you want to learn the ID of, send a message of any content to #JsonDumpBot. It will reply the whole JSON element that it receives from Telegram, including the ID of the user:
It's totally not safe to use other telegram versions available on internet, but I've seen that Telegram Plus has a ability to show you the chat_id of the user in their profile, even tho you don't have their contact.
Another way to extract chat_id of that particular user is that you have the phone number of that account, save it as your contact, then share it to this bot. It's easy to code it yourself but you can forward something from that user to this bot too, if you want to recieve the chat_id.
urmurmur has also mentioned another way. I haven't checked it yet but seems to be interesting.
Maybe you can try telethon:
from telethon import TelegramClient
def send_msg(name, msg):
with TelegramClient(session_file, app_id, app_hash, proxy=my_proxy) as client:
# client.loop.run_until_complete(client.send_message('me', 'hello')) # send 'hello' to saved messages
client.loop.run_until_complete(client.send_message(name, msg))
"name" can be "#xxxxx".
Then you can call send_msg(name, msg) in your bot.

Facebook API Send dialog

Here is my send javascript code:
function send(id, description, title) {
FB.ui({
app_id: '390841657651335',
method: 'send',
description: description,
link: http://vic.bg/Vits.aspx?vicid=' + id,
name: title
}
}
Send is always ok (i dumped the response from the callback to the console), but recients got that message
Attachment Unavailable This attachment may have been removed or the person who shared it may not have permission to share it with you
instead of the actual post. Did someone face that problem?
The problem was with the settings of the application Sandbox Mode: was checked.
I do not know why they display such strange message in that case
So, did the 'send dialog' worked for you? because from all of my research and reading all posts related, facebook currently doesn't allow to send private messages to friends through graph api..
I'm trying the 'send dialog' via a direct URL and not via JS SDK.

posting reply to inbox message?

I'm trying to post a reply to an inbox message by sending a POST request to /message_id/comments. Is this the correct way to send a reply to an inbox message ?
I'm getting the following error:
"error": {
"type": "OAuthException",
"message": "(#3) App must be on whitelist"
}
The token has every possible permission.
Do I have to ask that my app is added on a whitelist ? how to do so ?
I'm doing this in javascript+jQuery:
var params = {
access_token: token
, method: 'post'
, message: 'hi'
};
$.getJSON('https://graph.facebook.com/$message_id/comments?callback=?', params, function(json) {
});
Facebook apps by default aren't allowed to send messages on behalf of users. There is no permission you are missing. This is an extra level to prevent spam (beyond prompting the user who). You will have to contact Facebook to get your application whitelisted. I would try their developer group.
opened a support ticket right here:
http://developers.facebook.com/bugs/183144141763793?browse=search_4e8b140cbf26e6040457329
Tried all I can think of and googled for, still getting this issue
Like others have pointed out, there isn't a way to do this programmatically unless you are on Facebook's whitelist. However, I did find a way around this for my app. What I do is use Oauth to display messages from a user's FB inbox like normal. When the user clicks 'Reply' on a message, I just send them to the reply page on Facebook Mobile, like this:
$('.reply').click(function() {
var popup_window = window.open('http://touch.facebook.com/messages/compose?ids='+message_id, '_blank');
popup_window.focus();
});
Where message id is the Facebook id for the message they are replying to. In my case, I use PHP to echo the message id into a javascript variable or data-attribute when the page loads. Since the Facebook mobile page opens in a new tab, they don't even really leave my app. Since Facebook mobile has a very streamlined interface it isn't too distracting. It's not perfect, but it works and it's easier than trying to get whitelisted.

Send news feed with the new facebook.php class

Hi i'm new developer of fb apps and i want to know how can i send a message to the wall of my friends using the new facebook.php class http://github.com/facebook/php-sdk
I do it this
$result = $facebook->api('/me/feed/',
'post',
array($ids,'message' => 'Playing around with FB Graph..')
);
This code work for the firts time i can login in the application after i try to enter again and the application sending and error The message if duplicated.
How can i fixed or what if the best way to do?
Thanks.
The error you are having is because facebook wont let you send the same message to the same user multiple times hence the error duplicate message. Change the text of the message and the message will work.