How to post Facebook Application request from Windows phone 7 - windows-phone-7.1

Currently I am using Facebook c# SDK for my windowsphone7 application..,
I created friend list from which friend(thats facebook UID) is selected to send application request .
This is my code
arguments["access_token"] = "Accesstoken";
arguments["message"] = "message";
arguments["IDS"] = "IDS";
facebook.PostAsync("me/apprequests", arguments);
facebook.PostCompleted += facebook_PostCompleted;
But still request didn't post on facebook user profile.

The code looks correct so my guess is that you don't have the correct permissions. Have you asked the user for the publish_stream extended permission when you authenticate?
See: https://developers.facebook.com/docs/reference/login/extended-permissions/

Related

FacebookLogin loginWithReadPermissions does not request any new permissions

Ive previously requested public_profile, user_friends, and email which Facebook will let you use pretty freely in my Swift iOS app but now I'm trying to update the app to request new permissions with loginWithReadPermissions but when it transfers to the login page it just says that I've already granted my app permission and doesn't request the new permissions. Querying the results shows no granted or denied permissions and looking at the Graph Explorer API on the Facebook Developer site shows the same. So I'm looking for suggestions on why my app might not be sending the updated request to the server.
I should note that I'm utilizing the AWS iOS Mobile SDK. I found another answer that overwrites the default Facebook sign in provider to add new permissions to the request but this has the same result.
Also in my output Im seeing the following string which contains all the permissions Im trying to request which makes me think that the request is going out but something else is happening
scope=email%2Cuser_birthday%2Cuser_hometown%2Cuser_friends%2Cpublic_profile%2Cuser_about_me

FB message sending to friends on iOS app [duplicate]

I saw your post about sending messages to your Facebook friends via the IOS Facebook sdk,
I was wondering if there is a way to send a private message as well to these friends.
If not, is sending messages to your Facebook friends still supported from your previous post at:
iOS Development: How can I get a Facebook wall post to show in the friend's news feed?
If so let me know, thank you in advance
It is possible to send a private message via facebook- just not with the SDK. You can get the user's 'username' (ie. http://www.facebook.com/username) and you can send them an email via your app to 'username#facebook.com'.
Shapow!
Major bonus: attach a file and it will be included in the facebook message.
One caveat: the email will not reach the recipient's message inbox unless the sender's email address is affiliated with a valid facebook user account. I would imagine this is in place to thwart spam.
No, it is not possible to send private messages using the Graph API.
Yes, it is still possible to post to a friend's wall. I just checked it out just now using the graph API Explorer tool: http://developers.facebook.com/tools/explorer. I used /friendId/feed with an HTTP post of "message" = "testing" and my friend confirmed they saw it on their stream.
let messageDialouge = MessageDialog.init(content: <ShareContent>, delegate: nil)
if messageDialouge.canShow {
messageDialouge.show()
}
And do add fb-messenger-share-api inside the LSApplicationQueriesSchemes in info.plist

iOS facebook SDK 3 > Get the signed request

I try to get the signed request to login the user via a webservice but I only have access to the accessToken on FBSession.
I saw this link
Facebook Signed Request for iOS (HMAC SHA256)
who shows how to convert the signed_request but doesn't show how to get it.
Need help :)
If I undersand you right you want your app to login and then make a call to a server where you need to check the users credential again.
I used this tutorial for the authentication.
Then when I call the server I send the accessToken property as a parameter to check the users credentials on the server. You can get the token value like this:
FBSession.activeSession.accessToken
On the server side you can then set the access token to the value you got from the app.
I compiled a gist that generates a signed request which you can then use to authenticate a user on your server without having to query the graph API.
You can find it here: https://gist.github.com/3962188
You can find the original question I compiled it for here: Facebook iOS SDK to return a signed request object upon login
Please note that most of the code is simply a compilation of existing open source code, but I haven't seen any fully working implementation like this anywhere.

Why is the access token that I pass to appEngine from iOS invalid?

I am working on an iPhone game that maintains a leaderboard and some social interaction through a backend that I built in Google App Engine. The user can log in through facebook in the iPhone app. The app sends some user details including the access token to my Google App Engine app through an HTTP post.
The handler that receives the request tries to use the access token to retrieve the users friends. I am using the pythonforfacebook SDK (which I have had success with previously) which is on Github here:
https://github.com/pythonforfacebook/facebook-sdk
The relevant python code in my GAE app is as follows:
def post(self):
at = self.request.get('at')
user = User.get_by_key_name(uid)
if not user: #create previously unknown user
logging.info('Entered unknown user code')
logging.info(at)
logging.info(type(at))
graph = facebook.GraphAPI(at)
facebook_user = graph.get_object("me")
friends = graph.get_connections(facebook_user["id"], "friends")
The logging commands print what looks like a good access token and states that the type is 'Unicode'. When I copy the access token that logging.info prints to the GAE logs and paste it into the facebook access token debugger, I get the following output:
App ID: deleted for privacy but looks right
Metadata: {"sso":"iphone-safari"}
User ID: deleted for privacy but looks right
Issued: 1345405177 (10 minutes ago)
Expires: Never
Valid: True
Origin: Mobile Web Faceweb
Scopes: offline_access read_stream
I just updated my code to use the most recent posted version of pythonforfacebook but that didn't make any difference. Any ideas would be much appreciated.
Thanks,
Dessie
To get friends of the user you can do it pretty easily without the pythonforfacebook SDK.
https://graph.facebook.com/<username or ID>/friends?access_token=<your token>
That link will give you the friends of the user in JSON format. So if you import urllib2 and json you could do:
response = urllib2.urlopen(<url above>)
friendsString = response.read()
friends = json.loads(friendsString )
Then friends will be a dict containing of all the friends.

sending a private message to your friends via Facebook IOS SDK

I saw your post about sending messages to your Facebook friends via the IOS Facebook sdk,
I was wondering if there is a way to send a private message as well to these friends.
If not, is sending messages to your Facebook friends still supported from your previous post at:
iOS Development: How can I get a Facebook wall post to show in the friend's news feed?
If so let me know, thank you in advance
It is possible to send a private message via facebook- just not with the SDK. You can get the user's 'username' (ie. http://www.facebook.com/username) and you can send them an email via your app to 'username#facebook.com'.
Shapow!
Major bonus: attach a file and it will be included in the facebook message.
One caveat: the email will not reach the recipient's message inbox unless the sender's email address is affiliated with a valid facebook user account. I would imagine this is in place to thwart spam.
No, it is not possible to send private messages using the Graph API.
Yes, it is still possible to post to a friend's wall. I just checked it out just now using the graph API Explorer tool: http://developers.facebook.com/tools/explorer. I used /friendId/feed with an HTTP post of "message" = "testing" and my friend confirmed they saw it on their stream.
let messageDialouge = MessageDialog.init(content: <ShareContent>, delegate: nil)
if messageDialouge.canShow {
messageDialouge.show()
}
And do add fb-messenger-share-api inside the LSApplicationQueriesSchemes in info.plist

Resources