facebook-graph-api

How to encode a file from the file system as multipart/form-data?

青春壹個敷衍的年華 提交于 2020-01-24 01:14:29
问题 I want to let users upload photos to Facebook in my image viewer app. As seen in this post, Facebook Graph API - upload photo using JavaScript, I have to encode my photos as multipart/form-data to be able to upload them. How to archive this encoding on Windows.Storage.StorageFile items? 回答1: You need to open that photo (of type Windows.Storage.StorageFile ) for reading, convert it's stream to blob, append it to FormData object and upload using whatever Ajax library you want ( WinJS.xhr ,

Facebook api swift current user is nil

主宰稳场 提交于 2020-01-24 00:43:31
问题 I have a problem with Facebook api. After login and success unwrapping user token I have a problem with taking user profile: it's nil. func updateLoginStatus() { if let _ = AccessToken.current { let currentUser = UserProfile.current userName.text = currentUser?.fullName userPictureView = UserProfile.PictureView(frame: blankUserImage.frame, profile: currentUser) userPictureView!.clipsToBounds = true userPictureView!.layer.cornerRadius = userPictureView!.bounds.width/2 popUpView.addSubview

Facebook iOS SDK - creating user owned objects and publishing an open graph story without a backend server

别说谁变了你拦得住时间么 提交于 2020-01-23 21:17:14
问题 My goal is to achieve something along the lines of this without implementing a backend web server: currently, I am using this code: id<FBOpenGraphAction> _action = (id<FBOpenGraphAction>)[FBGraphObject graphObject]; _action[@"book"] = @{ @"type":@"books.book", @"fbsdk:create_object": @YES, @"title":@"test title 1", @"url":@"http://test-test.test", @"image":@"http://www.m5zn.com/uploads/2010/7/15/photo/071510030742woekhs48rdt1ifcwp.jpg", @"description": @"development in progress - test

Facebook iOS SDK - creating user owned objects and publishing an open graph story without a backend server

纵然是瞬间 提交于 2020-01-23 21:12:47
问题 My goal is to achieve something along the lines of this without implementing a backend web server: currently, I am using this code: id<FBOpenGraphAction> _action = (id<FBOpenGraphAction>)[FBGraphObject graphObject]; _action[@"book"] = @{ @"type":@"books.book", @"fbsdk:create_object": @YES, @"title":@"test title 1", @"url":@"http://test-test.test", @"image":@"http://www.m5zn.com/uploads/2010/7/15/photo/071510030742woekhs48rdt1ifcwp.jpg", @"description": @"development in progress - test

Facebook iOS SDK - creating user owned objects and publishing an open graph story without a backend server

我们两清 提交于 2020-01-23 21:12:18
问题 My goal is to achieve something along the lines of this without implementing a backend web server: currently, I am using this code: id<FBOpenGraphAction> _action = (id<FBOpenGraphAction>)[FBGraphObject graphObject]; _action[@"book"] = @{ @"type":@"books.book", @"fbsdk:create_object": @YES, @"title":@"test title 1", @"url":@"http://test-test.test", @"image":@"http://www.m5zn.com/uploads/2010/7/15/photo/071510030742woekhs48rdt1ifcwp.jpg", @"description": @"development in progress - test

Using social plugins for pre-existing Facebook posts

一笑奈何 提交于 2020-01-23 12:48:18
问题 If there a way to use the Facebook Feed, Comments, and Like social plugins for existing Facebook posts? We're looking for a way to have pages on our site supplementing existing Facebook posts made on our FB page. The goal is to keep all sharing, comments, and likes centralized around single post, rather than the usual model where each person shares a distinct post on their feed. Example post from McDonalds: http://www.facebook.com/photo.php?fbid=10151001277817014&set=a.10150319191897014

Graph Api Not Getting Location from Facebook SDK in Android

爱⌒轻易说出口 提交于 2020-01-23 08:03:30
问题 I'm using Facebook SDK in my Android App. And I need to get all the information of the user. By now I'm able to get the Name ID Email Birthday and the profile pic of the user. The last one that I need to get is the location or current location of the user. I'm using this code below. if(fb.isSessionValid()){ button.setImageResource(R.drawable.logout_button); JSONObject obj = null; URL img = null; try { String jsonUser = fb.request("me"); obj = Util.parseJson(jsonUser); String id = obj

Facebook , How to get phone number after login with facebook sdk?

我怕爱的太早我们不能终老 提交于 2020-01-23 02:01:12
问题 I have integrated FB sdk for customer login and not able to get phone number in response. Here is my code FB.api('/me', {fields: "id,email,first_name,gender,name,last_name,token_for_business"}, function(response) { }); With that above code, I am getting all information expect phone number. I have passed extra parameter mobile_phone then getting undefined response. Here is code FB.api('/me', {fields: "id,email,first_name,gender,name,last_name,token_for_business,mobile_phone"}, function

Post to facebook page wall as a page

谁都会走 提交于 2020-01-22 12:43:30
问题 I want to post to facebook page wall as a page using PHP. I've got access_token by below links. https://graph.facebook.com/oauth/authorize?type=user_agent&client_id=123456789&redirect_uri=http%3A%2F%2Fmysite.net&scope=publish_stream,manage_pages,offline_access https://graph.facebook.com/me/accounts?access_token=... I'm using this simple code: $appid = ""; $secret = ""; $pageid = ""; $access_token = ""; require_once("facebook-php-sdk/src/facebook.php"); $facebook = new Facebook(array( 'appId'

Post to facebook page wall as a page

回眸只為那壹抹淺笑 提交于 2020-01-22 12:42:56
问题 I want to post to facebook page wall as a page using PHP. I've got access_token by below links. https://graph.facebook.com/oauth/authorize?type=user_agent&client_id=123456789&redirect_uri=http%3A%2F%2Fmysite.net&scope=publish_stream,manage_pages,offline_access https://graph.facebook.com/me/accounts?access_token=... I'm using this simple code: $appid = ""; $secret = ""; $pageid = ""; $access_token = ""; require_once("facebook-php-sdk/src/facebook.php"); $facebook = new Facebook(array( 'appId'