Sending message using facebook android sdk - android

I wish to develop an Android app where the user can send messages by clicking a button and the send dialog box should appear whereby the user can send personal message to his friends.
However, this is not well documented in the FB site.
The feed dialog is appearing without error and I can post to wall but when I replace "feed" with "send", it gives an error saying "An error ouccured with MyApp. Pls. try again later.
http://developers.facebook.com/docs/guides/mobile/#android
The last item in the android post is how to get post dialog method.

You can't send in general but there could be some workaround... But that couldn't be generalized in that way... Because you have to use an API for that and there is not currently any support for that what I suppose you can read but can't write... http://developers.facebook.com/blog/post/291 is the reference for details...

You can't send a message with the Dialog (source: http://developers.facebook.com/docs/reference/androidsdk/dialog/):
void dialog(Context context, String action, DialogListener listener)
action - The type of dialog to call. Currently supported methods are feed, apprequests and oauth.
So, "send" is not a supported method.

Related

Send verification code to Android Device and show in Dialog

A friend of mine showed me his home office today. After he was logging in with his username and password on a website, he received a message on his Android smartphone with a verification code for the website, a 2-factor authentication system. The message appeared inside a Dialog with a confirm Button. I'm just wondering how you can send a message to an Android device, so it will be displayed like this. I tried to search for this, but all I can find is just how to set up Dialogs in Android.
Due to the abstract nature of your question, Heres an approach.
Firstly you would need to tie up with an sms provider.There are lots of them with their set of apis and pricing (for eg http://www.twilio.com)
Secondly in android you could listen for incoming messages.
Android – Listen For Incoming SMS Messages
Hope this helps
There are various option, but I guess you can use this:
AlertDialog alert = new AlertDialog.Builder(Myclass.this).create();
alert.setTitle("Verfication code");
alert.setMessage("your verification code is "+xyz);
alert.setButton("confirm",new DialogInterface.onClickListener(){
public void onClick(DialogInterface d, int x){
//logic
}
});

Post to several friend's timeline via FaceBook feed dialog

Since request "id/feed" was deprecated, I'm trying to implement Facebook feed dialog to post to user's friends timelines.
I found in documentation parameter "to", where I can define ID of the user post to.
But if I want to post one message to several friends, how can I do that?
I'm trying to use something like "user_id_1,user_id_2,user_id_3" but it does not work.

Facebook apprequest messages are not displayed on receiver's notifications list

I am trying to send a direct message to friends using Facebook Dialogs on Android. The code that does is as follows:
Bundle params = new Bundle();
params.putString("message", "sending direct messages");
params.putString("to", friendId);
mFacebook.dialog(FBFriendsActivity.this, "apprequests", params, new PostDialogListener());
The code executes well. No error. The Facebook send dialog shows up, and I click on send. but, I do not see any notifications listed on the receiver's notifications.
Do I have to have a facebook app in order for this to work? If so, how do I send user-to-user requests?
I would assume one of three things.
You application is still in test mode
The app request went to a test user rather than a normal user account
Most importantly, your app may not be properly configured as a canvas app.
See https://developers.facebook.com/docs/reference/dialogs/requests/ for more information
what do you mean by "direct message"? inbox message? I don't think Facebook Android API supports this...
yes, you need a Facebook app, otherwise how do you instantiate mFacebook? Suppose it is Facebook mFacebook = new Facebook("YOUR_APP_ID");. But I think you do have your Facebook app, because you said a dialog had shown and you had clicked the send.
for your code, that is what you would do if you want to send app requests to your friends.
you may want to take a look at this tutorial which shows you the key steps for the Facebook integration.
https://developers.facebook.com/docs/mobile/android/build/#register

Add Friend through Facebook Dialog - Android Facebook SDK

I am currently developing an Android app using the Facebook API. One module of my application consists in adding a friend (knowing the ID) and I would like to add a friend through the FB Dialog object.
I used the Facebook object with dialog method:
http://developers.facebook.com/docs/reference/androidsdk/dialog/ .
as well as the FbDialog class to try adding a friend through a dialog:
http://developers.facebook.com/docs/reference/dialogs/friends/ .
However, as it is written in the documentation only feed and oauth are supported through this dialog. As a consequence, when I use this dialog trying to add a friend, either it redirects me to my browser and the AddFriend web dialog, or it successfully open a dialog but with a message saying that this is not supported.
My question is: is it possible to have this dialog working with the Add friend mechanism in spite of what the documentation says? Maybe one of you guys has found a trick to do so. Or maybe it is just not possible, and I have to stay with this method (that is opening the web browser), which I find not very user-friendly for my app.
Thanks in advance!

Android: Is there a way to make facebook.dialog less ugly? - Screenshot attached

I'm very close to having what I need for my facebook dialog, the post is working successfully, which has taken me a fair amount of time as i've struggled with the facebook sdk.
When I open the dialog to post a message to the feed ( or when I call authorise in a dialog ), it shows as shown here:
http://minus.com/mg6utFaHf
I'm looking for something more like this:
Any ideas why mind is showing so... ugly?
It's very square, in a webview, with the X in the top left.
Thanks, any help is much appreciated.
The new Facebook SDK should allow you to use the built in Facebook app to do such things via intent.
In alternative you could use the Intent ACTION_SEND to achieve what you want.
The new SDK of theirs implements a way of authorizing called Single Sign-On which searches the device for the presence of the Facebook app and sends an Intent to that app which will authorize for you. If the Facebook app is not found then it will fall back to the dialog method.
You'll still be stuck with square iOS-y like design for in app sharing, invite friends, etc. The only way I can think of getting around this is to use FQL but how to do that is beyond my knowledge.
http://minus.com/mg6utFaHf is just the standard facebook Feed dialog ... see https://developers.facebook.com/docs/reference/dialogs/feed/ ... just change www. to m. as for example https://m.facebook.com/dialog/feed?app_id=123050457758183&link=https://developers.facebook.com/docs/reference/dialogs/&picture=http://fbrell.com/f8.jpg&name=Facebook%20Dialogs&caption=Reference%20Documentation&description=Using%20Dialogs%20to%20interact%20with%20users.&redirect_uri=http://www.example.com/response
Said that if you want it different you have to implement UI and post data by your own by Graph api

Categories

Resources