w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Posting a custom story to the graph API using Facebook iOS SDK 3.5
i see that this is old question - but there are still no good answers - so i hope to help smb. create object: - (NSDictionary *)sharingDictionaryForXXX { return @{ @"type" : @"app_namespace:object_name", @"fbsdk:create_object" : @YES, @"title" : "title text", @"url" : @"link to your site configured in app dashboard", @"image" : @"https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png", @"description" : "your description", }; } share: id<FBOpenGraphAction> action = [FBGraphObject openGraphActionForPost]; action[@"object_name"] = [self sharingDictionaryForXXX]; FBOpenGraphActionShareDialogParams * params = [[FBOpenGraphActionShareDialogParams alloc] init]; params.actionType = @"app_namespace:action_name"; params.action = action

Categories : IOS

Posting a Custom Story to Facebook Open Graph
To post actions with an object, you need to provide the url of this object. But in the case where you don't have this url on your own app (you app doesn't have a webpage for each object), then you can create objects hosted directly by facebook, and the url will use the generated id of this object. To do that, you need to use the Object API : https://developers.facebook.com/docs/opengraph/using-object-api/ Providing the json data, it will create the object in facebook opengraph, returning its id (so you have the url) and then you'll be able to post your action

Categories : Facebook

Facebook iOS share open graph story with custom buttons
This is called an "action link". You can read about it here: https://developers.facebook.com/docs/opengraph/howtos/action-links/

Categories : IOS

Publishing a story using Facebook open graph
The page opengraphobject.php should contain the sample code provided in that step. So when you are done setting it up you point to your url in the debugger to test https://YOUR.herokuapp.com/opengraphobject.php?fb:app_id=YOUR_APP_ID &og:type=fb_sample_scrumps:meal &og:title=Pizza &og:description="Pizza" &og:image=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fimages%2Fdevsite%2Fattachment_blank.png &body=Pizza

Categories : Facebook

Different types of Facebook open graph story?
You must have a different description that the title. Here you have "Beat" twice it's why you have the url shown instead of a description. The size of the asset cannot be changed by yourself, you must provide a big asset (600*600 for instance) but facebook will show the big or small asset depending on the quality of your story. KingsRoad use explicit sharing: http://developers.facebook.com/docs/opengraph/guides/explicit-sharing/ which is a good idea if you want big assets, because this king of stories are user-generated (so have a great value)

Categories : IOS

OAuthException when posting story with Facebook Open Graph
You have used app as property name in the JavaScript object that you pass to FB.api: FB.api( 'me/objects/pruebablackbear:app', 'post', { app:"http://facebookapp.orionhub.org:8080/index.html", privacy:{'value': 'SELF'} }, but that seems to be the name of your action - the parameter must use the same name that the object you are performing the action upon is called. So if your object was named banana, it would be: FB.api( 'me/objects/pruebablackbear:app', 'post', { banana:"http://facebookapp.orionhub.org:8080/index.html", privacy:{'value': 'SELF'} }, Edit: I think that’s what it should lo

Categories : Facebook

Error code 5 when publishing Facebook Open-Graph story through iOS?
Before calling startForPostWithGraphPath, make sure the session is open: NSLog(@"activeSession isOpen: %d", [[FBSession activeSession] isOpen]); make sure the session has 'publish_actions' permissions: NSLog(@"session perms: %@", [[FBSession activeSession] permissions]); if not, if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) { then ask for permission: if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) { defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *session, NSError *error) {

Categories : IOS

Facebook Open Graph follow action provokes an error when uses Open Grahp Test User as a profile
I faced the same issue as you did and filed a bug with Facebook: https://developers.facebook.com/bugs/1509327415958565 Facebook was able to reproduce this issue and are mentioning it appears to be a bug and assigned this task to the appropriate team. Edit: It turns out this behavior is by design when a test user is following a real user. FB recommends for testing to use 2 test users and let one test user follow the other test user.

Categories : Facebook

Custom link in an open graph story
As far as I know this link leads to one of: Canvas URL if you have a canvas app Site URL if you have no canvas app just website with fb login You can set both in App Settings (https://developers.facebook.com/apps/) Looking through the logs it's impossible to distinguish it from people just accessing the app.

Categories : Ruby On Rails

How can i add singular 'the' instead of 'a/an' before object in open graph story
You can use the og:determiner in your OG object’s meta data (as long as your object is represented by an URL pointing to an HTML document containing OG meta tags): og:determiner - The word that appears before this object's title in a sentence. An enum of (a, an, the, "", auto). (http://ogp.me/#optional)

Categories : Misc

Is it possible to add a custom parameter in a Open Graph story with a common action?
I do not think this is possible. Looking at both the run action and the course object you cannot add custom properties. For example, when you go to configure the run action you see the following message at the top "Common Action Type: Run You are viewing the configuration options for the common Action Type: Run. These are read only and are displayed for informational purposes only." However you might want to consider using User Messages which "allow users to write a personalized message attached to this action." Then you could encourage users to write something about what they helped to do.

Categories : Facebook

Facebook create Open Graph object with custom field
I was actually trying to find answer to this very question. I came across this SO post that helped me: Facebook create Open Graph object with custom field You need to pack your custom attributes into an object named data in the json you're sending to the open graph. So something like this: { "type":"fooapplication:spot", "title":"test", "description":"", "image":"someimage-url", "data":{ fooattribute":"Test" } } Full disclosure I was doing this via the iOS SDK but the process seems to be the same. Hope this helps.

Categories : Facebook

Locations Connections of Facebook Graph Api User object not responding properly in ios-sdk?
Seems like that function doesn't consider the parameters as a part of the path. You can use this: - (FBRequest*)requestWithGraphPath:(NSString *)graphPath andParams:(NSMutableDictionary *)params andDelegate:(id <FBRequestDelegate>)delegate; source: https://developers.facebook.com/docs/reference/iossdk/request/ where params will be: NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; [dict setObject:@"locations" forKey:@"fields"];

Categories : IOS

iOS Facebook get user's profile image randomly opens profile homepage instead of permission dialog
This is how I would collect the User Profile picture, although there are plenty of ways to do this: I would use a notification (or any other method) to notify once the user is signed in, then call a method to collect the Facebook Profile picture. Once they are logged in you can pass their facebook Id to a value. (kUserFacebookIDKey) NSLog(@"Downloading user's profile picture"); // Download user's profile picture NSURL *profilePictureURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?type=large", self.kUserFacebookIDKey]; NSURLRequest *profilePictureURLRequest = [NSURLRequest requestWithURL:profilePictureURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0f]; // Facebook profile picture cache policy: Expires in 2 weeks [NSURLCo

Categories : IOS

Facebook Graph API - Get profile picture prior to authenticating
I also have questions for you: How do you want to display the picture of someone without knowing who he/she is? How can you guess which account the visitor will use to connect? It looks like you want to know whose Facebook account was lastly connected on the browser of your visitor. Technically, you would want to read another site's cookies, which is 1) not allowed 2) impossible. Several additional things you need to know: http://graph.facebook.com/USERNAME_OR_USERID/picture is a public way to retrieve someone's photo. You don't need a token for that. What else do you need? Using FB.API("/me", ...) from the JS SDK implies that "me" represents the connected user. It cannot just be used alone. By the way, identical questions have already been answered and accepted: Facebook app wi

Categories : Javascript

How To Retrive Facebook Profile Picture Comments using Graph API or FQL
To get the id of the profile picture- Get all facebook albums of the user by - /me/albums Demo Loop through the each object of the above albums and check if - type == 'profile' and get the album id from this object. For this album_id, get the value of object cover_photo /<album-id>?fields=cover_photo Demo This value of cover_photo is the id of profile pic of the user.

Categories : Android

Retrieving Facebook profile picture with graph / app access token?
Yes, there is much more easy way! You can directly use the user id: <img src="https://graph.facebook.com/{USER_ID}/picture?return_ssl_resources=1" alt="" /> Fx. if you want to get Mark Zuckengerg picture you can use: <img src="https://graph.facebook.com/112845672063384/picture?return_ssl_resources=1" alt="" />

Categories : PHP

Facebook Graph API - access_token=app_id|app_secret - search Graph API without user login
According to Facebook The following changes will go into effect on July 10, 2013: ..... Graph API search changes App access tokens will be required for all search Graph API calls except Places and Pages. Search for application will no longer be supported.

Categories : C#

Open graph story posted succesfully using graph API but not seen neither on the timeline nor in the Activity Log
I could totally be wrong, but you may need to submit your Open Graph action to Facebook for approval. And you'll need to set explicit sharing if you want your action to show in places other than your own timeline and activity. I say I could be wrong because you should at least be able to see your action within your activity log. It's difficult to say without looking more closely at your Open Graph Action and Object.

Categories : Facebook

Fetch facebook user public data, which available without loggining througth Facebook Graph API if any exists
This isn't possible unless you have an access token. The public graph doesn't reflect the browser information it reflects what is given in the documentation https://developers.facebook.com/docs/reference/api/user/

Categories : Java

Retrieve zip code of a facebook user by facebook graph API
If you check the documentation for the /me call at https://developers.facebook.com/docs/reference/api/user/ you'll note that there is no reference to the user's zip or postal code. I'd recommend you use ask for the user_location permission and then call /me?fields=location and try to derive the zip code from the information contained therein - this answer http://stackoverflow.com/a/7129344/2091159 - has some information about doing so.

Categories : PHP

How can a Facebook app get a box on a user's profile?
This is called Collections which can contain app and activity-driven sections. Quoting from Facebook documentation These sections let people express to the world the things that they care about the places they've been or the things they've done. Facebook provides default sections that people can optionally populate from common options (actions) generated by apps. As an example, Facebook provides a Books section, which is populated by the common actions like books.read and books.wants_to_read. If you've created custom actions and objects you can create custom collections for your app. Those collections will be available in your app's section. These sections aren't shown on the timeline by default, but you can ask them to add your section to their Timeline.

Categories : Facebook

Facebook Javascript SDK open-graph: error adding custom objects for custom stories
The object is a JSON-encoded version of an object, the sample code generated for you was incorrect. Also remove type from the parameter list. So something like, FB.api( 'me/objects/[namespace]:opinion', 'post', { object: {"app_id":xxx,"url":"http://samples.ogp.me/331257847005141","title":""Sample Opinion"","image":"https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png","description":""""} }, function(response) { // handle the response } ); An example of how it looks can be seen at http://philippeharewood.com/facebook/objectify.html and it was based off the curl example given at https://developers.facebook.com/docs/opengraph/using-object-api/

Categories : Javascript

Facebook - Send friend request (User to User) using graph API and PHP SDK?
You can use the Friends Dialog. To integrate you can use javascript as- FB.ui({ method: 'friends', id: USER_ID }, function(response){}); OR, a URL redirect as- https://www.facebook.com/dialog/friends/? id=USER_ID &app_id=APP_ID &redirect_uri=REDIRECT_URI For more details: Friends Dialog

Categories : PHP

Facebook open graph custom stories and custom objects with js sdk
I think you are using football as a wrong way of specifying your story. You are using name of the instance instead of class. Let me explain. Following are the two scenarios I could come up with: Your app is about games that users play. So in this case your object becomes game and football will be the name of the game. So now your story reads like: "A played football with B and C via your_app" since you will be providing the name property of the game object, facebook will select the right story sentence for you Your app is about sports products, in which case your object becomes sport_product or product and football will be an instance of sport product. But in this case an action of play does not make any sense. So lets say buy is an action. So now your story reads like: "A bought foot

Categories : Facebook

Get specific fields on user profile. Facebook SDK PHP
Well, you need to read some documentation, there is a lot regarding PHP and Facebook. To get the name you can do the following: $name = $user_profile['name']; To get the username will be easy too (I don't remember exactly what's the key for the username in that array), but you can print all the information from $user_profile by doing the following: print_r($user_profile); or var_dump($user_profile); Then you can capture what you need doing the same way as above.

Categories : PHP

How to get logged in user profile picture. Facebook SDK 3.5
You are getting Network on main thraed exception. So, try to do your process in a asynctask or try using, if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } in your onCreate() after setContentView(R.layout.xxx);

Categories : Android

Match existing user profile with facebook, gmail and twitter
If you have an user and it uses facebook or gmail OAuth for login, you can identify it by looking in your current users table by his e-mail (assuming you required e-mail confirmation in your system, or else it can become a real mess). Twitter, by other hand, doesn't allow you to see the e-mail from the user, so you will have to look for an alternate way. The more straight-forward way to unite the user account with an external user account is simply ask to add bound the accounts in the first OAuth login. Forgetting their login details doesn't seems to be the best motive to use OAuth, but to implement a "forgot password/login" feature. OAuth is supposed to improve your users experience by being connected to other services as well, and use the same "friends" or "share" things in an easier wa

Categories : Ruby On Rails

Social, Accounts framework to get user info from facebook (profile image,name,etc)
After some hours of debugging and research i reach the solution, everytime you have to debug a block (callback) of a method in objective-c, its needed to add extra breaktimes inside the block. The issue was a problem of synchronism, as the method was call in the main.m and the UIAlert requesting permission to access facebook data in the iPhone never appears. I move the call of the method to the viewDidLoad and the entire app work ok!

Categories : IOS

Django custom user VS user profile
When you have it all in one table, then database access is faster. With the old way you had to join on the auxiliary table to get all the information of the user. Usually when you see a One-to-One relation, it would be better just to merge them in one table. But the new custom User model solves also another problem, which is what atributes a User should have? What attributes are essential for your application? Is an email required? Should the email be also the username with which a user logs in? You couldn't do these stuff before this feature was introduced. Regarding your question about where to put additional user information like "hobbies" and such, it really depends on how often you will query/need this attributes. Are they gonna be only on the user's profile page? Well then you co

Categories : Python

get facebook graph user from Respone
According to the documentation, you can use http request on https://graph.facebook.com/me?fields=id&access_token=replace-this-by-your-access-token to get the id of the logged in user

Categories : Android

Facebook graph api: How to get last edit time of user name
Late to the topic, but I noticed that when the User is viewed as a Map (via the Android API), there is an attribute called updated_time. Here's a snippet that demonstrates: Request.newMeRequest(session, new Request.GraphUserCallback() { @Override public void onCompleted(final GraphUser user, final Response response) { for (final Map.Entry<String, Object> entry : user.asMap().entrySet()) { logger.debug("User {}: {}", entry.getKey(), entry.getValue()); } } }).executeAsync(); Which yields (among other attributes): 08-25 17:58:08.531: D/AbstractActivity(21850): User updated_time: 2012-05-25T11:46:32+0000

Categories : Facebook

Get facebook friends from open graph user
I think I figured it out. If you use a request, you can find a list of the users friends using the current session. The code I use is Request.executeMyFriendsRequestAsync(Session.getOpenSession(), new GraphUserListCallback() { @Override public void onCompleted(List<GraphUser> users, Response response) { // TODO } });

Categories : Android

Check if user has liked a post or not with Facebook Graph API
Here are solutions to a couple of your problems: Problem: is that when ever i run this code,it shows only one post from newsfeed.but if i remove the following code from the code,it will fetch 20 posts from newsfeed. I don't know whats happening. $ret = $facebook->api(array( 'method' => 'fql.query', 'query' => "SELECT like_info FROM $type WHERE object_id=$object_id" )); $checklike = $ret['data']['like_info']['user_likes']; Answer: Above code is filtering your contents, here you are checking whether your each of the 20 posts (which you are pulling) and looping individually and checking if it is a status, photo, video, link, etc is liked by the logged in user or not? Above query works only for type = Photo,type = Link, as far as I remember only Photos, Links have like_info obje

Categories : PHP

Facebook Graph API to search user statuses
You'll have to manually go through the statuses returned from /me/statuses to find the ones that you care about. Facebook doesn't really let you use their computing power to search stuff like that.

Categories : Facebook

Graph Story Image Upload
From my comment in your other question: You can't upload an image to your me/: endpoint. You need to POST it to me/staging_resources first. See this how-to on using the Object API (specifically step 3 for image uploading). https://developers.facebook.com/docs/howtos/androidsdk/3.0/share-using-object-api/ To add the image to your open graph action, do something like: JSONObject obj = new JSONObject(); obj.put("url", <your staging uri here>); obj.put("user_generated", true); myAction.setImage(Arrays.asList(obj));

Categories : Android

how to get to the post id of shared story with graph api
Using fql get page_story_id(Please refer to https://developers.facebook.com/docs/reference/fql/photo): Retrieve the page_story_id details: Access the exact page at www base facebook using this page_story_id(replace underscore with "/posts/"): The post_id can get via https://graph.facebook.com/420619404634864/feed too: Or fql: Updates: For video, it is easier compare with photo type to find post_id from object_id. As you can see on the screenshot, concate page id "155483697799865" and object id "4320084459885" with underscore is equal to post_id "155483697799865_4320084459885": Let's visit the story page using these post_id(Again, replace underscore with "/posts/"): To be clarify, what i answer is get original post_id for this object id, not post_id of share status. For e

Categories : Facebook

Is there a way to fetch all posts in a user's facebook wall through graph api?
You can instead use FQL instead of Graph API for your case. You can query the stream table to retrieve the status created between certain dates. For example to retrieve status updates between 21th June and 28th June you can create FQL like SELECT post_id,message,actor_id, attachment, description FROM stream WHERE created_time > 1371790800 and created_time < 1372442741 and source_id = me() and actor_id = me()

Categories : Facebook

How to get a Facebook user's current location using Graph API in JavaScript SDK?
You can use same as PHP Facebook SDK: // PHP $user_location = $facebook->api('/me?fields=location'); // Java Script FB.api('/me?fields=location', function(response) { console.log(response); });

Categories : Facebook

Custom objects Facebook android open graph
The object is a JSON-encoded version of an object, the sample code generated for you was incorrect. Also remove type from the parameter list. The object: The object is a JSON-encoded version of an object. The types used here are the types used in the books.book type. You can also include any of the standard properties. Note that the type is not included in the call. This is because it's implied from the path that you used when you made the call. See properties for why there's a data element in the JSON. It is used to create objects which can then be used to create actions. See Facebook developers

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.