Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-06-2009, 09:12 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Ireland
Age: 21
Posts: 472
Default FBConnect API

Solved
__________________
On the iOS App Store

Last edited by kieran12; 11-06-2009 at 10:35 AM.
kieran12 is offline   Reply With Quote
Old 12-02-2009, 07:41 AM   #2 (permalink)
iOS Dev
 
Join Date: Aug 2009
Location: Chandigarh
Posts: 39
Send a message via Skype™ to Jango
Thumbs up

Quote:
Originally Posted by kieran12 View Post
Solved
Hi,
I'm seeking a method to implement some of the methods through fbconnect.

Please let me know if you have implemented the methods.

Incase you have, I will need your help.

Cheers.
Jango is offline   Reply With Quote
Old 12-02-2009, 08:18 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by Jango View Post
Hi,
I'm seeking a method to implement some of the methods through fbconnect.

Please let me know if you have implemented the methods.

Incase you have, I will need your help.

Cheers.
Which methods.

Here's examples for publish feed and upload photo.

PHP Code:
- (void)publishFeed:(id)target 
    
FBStreamDialogdialog = [[[FBStreamDialog allocinitautorelease];
    
dialog.delegate self;
    
dialog.userMessagePrompt = @"Write Something on your wall";
    
dialog.attachment = @"{\"name\":\"Streams\",\"href\":\"http://www.mooncatventures.com\",\"caption\":\"Caption\",\"description\":\"Description\"}}}";
    
// replace this with a friend's UID
    // dialog.targetId = @"999999";
    
[dialog show];
}

- (
void)setStatus:(id)target {
  
NSString *statusString = @"Testing iPhone connection";
    
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                            
statusString, @"status",
                            @
"true", @"status_includes_verb",
                            
nil];
    [[
FBRequest requestWithDelegate:selfcall:@"facebook.users.setStatus" params:params];
}


- (
void)uploadPhoto {
// NSString *path = @"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg";
 
NSURL    *aUrl  = [NSURL URLWithString:url];
 
NSData   *data = [NSData dataWithContentsOfURL:aUrl];
 
UIImage  *img  = [[UIImage allocinitWithData:data];
 
NSDatacData UIImageJPEGRepresentation(img1.0);
 
UIImage  *image  = [[UIImage allocinitWithData:cData];

     
NSDictionary *params nil;
 [[
FBRequest requestWithDelegate:selfcall:@"facebook.photos.upload" params:params dataParam:(NSData*)image];
     
NSLog(@"image uploaded");
     
 }

- (
void)uploadLowPhoto {
    
NSURL    *aUrl  = [NSURL URLWithString:url];
    
NSData   *data = [NSData dataWithContentsOfURL:aUrl];
    
UIImage  *image  = [[UIImage allocinitWithData:data];
    
    
NSDictionary *params nil;
    
CGRect rectJpg CGRectMake(0.00.0800600);
    
UIGraphicsBeginImageContext(rectJpg.size);
    [
image drawInRect:rectJpg];
    
NSData *jData UIImageJPEGRepresentation(UIGraphicsGetImageFromCurrentImageContext(),0.9);
    
UIImage  *img  = [[UIImage allocinitWithData:jData];
    
//photoImageView.image = img;
    
[[FBRequest requestWithDelegate:selfcall:@"facebook.photos.upload" params:params dataParam:(NSData*)img]; 
michelle is offline   Reply With Quote
Old 12-02-2009, 08:44 AM   #4 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by michelle View Post
Which methods.

Here's examples for publish feed and upload photo.

PHP Code:
- (void)publishFeed:(id)target 
    
FBStreamDialogdialog = [[[FBStreamDialog allocinitautorelease];
    
dialog.delegate self;
    
dialog.userMessagePrompt = @"Write Something on your wall";
    
dialog.attachment = @"{\"name\":\"Streams\",\"href\":\"http://www.mooncatventures.com\",\"caption\":\"Caption\",\"description\":\"Description\"}}}";
    
// replace this with a friend's UID
    // dialog.targetId = @"999999";
    
[dialog show];
}

- (
void)setStatus:(id)target {
  
NSString *statusString = @"Testing iPhone connection";
    
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
                            
statusString, @"status",
                            @
"true", @"status_includes_verb",
                            
nil];
    [[
FBRequest requestWithDelegate:selfcall:@"facebook.users.setStatus" params:params];
}


- (
void)uploadPhoto {
// NSString *path = @"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg";
 
NSURL    *aUrl  = [NSURL URLWithString:url];
 
NSData   *data = [NSData dataWithContentsOfURL:aUrl];
 
UIImage  *img  = [[UIImage allocinitWithData:data];
 
NSDatacData UIImageJPEGRepresentation(img1.0);
 
UIImage  *image  = [[UIImage allocinitWithData:cData];

     
NSDictionary *params nil;
 [[
FBRequest requestWithDelegate:selfcall:@"facebook.photos.upload" params:params dataParam:(NSData*)image];
     
NSLog(@"image uploaded");
     
 }

- (
void)uploadLowPhoto {
    
NSURL    *aUrl  = [NSURL URLWithString:url];
    
NSData   *data = [NSData dataWithContentsOfURL:aUrl];
    
UIImage  *image  = [[UIImage allocinitWithData:data];
    
    
NSDictionary *params nil;
    
CGRect rectJpg CGRectMake(0.00.0800600);
    
UIGraphicsBeginImageContext(rectJpg.size);
    [
image drawInRect:rectJpg];
    
NSData *jData UIImageJPEGRepresentation(UIGraphicsGetImageFromCurrentImageContext(),0.9);
    
UIImage  *img  = [[UIImage allocinitWithData:jData];
    
//photoImageView.image = img;
    
[[FBRequest requestWithDelegate:selfcall:@"facebook.photos.upload" params:params dataParam:(NSData*)img]; 
also see this

Facebook connect add to Streams , soon for photostreams - Life in The Clouds
michelle is offline   Reply With Quote
Old 12-03-2009, 08:58 AM   #5 (permalink)
iOS Dev
 
Join Date: Aug 2009
Location: Chandigarh
Posts: 39
Send a message via Skype™ to Jango
Thumbs up

Quote:
Originally Posted by michelle View Post
Thanks a lot..
I'm currently working on it.

I need to implement friends.get and photos.get

Will be posting if I get through.

Cheers.
Jango is offline   Reply With Quote
Old 12-03-2009, 09:47 AM   #6 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by Jango View Post
Thanks a lot..
I'm currently working on it.

I need to implement friends.get and photos.get

Will be posting if I get through.

Cheers.
I'm planning on working on photos.get tonight.

I think FQL might be easier than using the api.

Just do a generic call to get the photos for all albums.

might have to select the albums first, then go after the photos for each album. right now all my photos just post to a single iphone album, but soon I will add the ability to create albums. So I need both.

I will post code to, when I figure it out.

Documentation is usable but not great, FQL is a lot like normal SQL so its not to hard to figure out.

The functions return in most cases a NSDictionary Object.
michelle is offline   Reply With Quote
Old 12-04-2009, 12:35 AM   #7 (permalink)
iOS Dev
 
Join Date: Aug 2009
Location: Chandigarh
Posts: 39
Send a message via Skype™ to Jango
Default

Quote:
Originally Posted by michelle View Post
I'm planning on working on photos.get tonight.

I think FQL might be easier than using the api.

Just do a generic call to get the photos for all albums.

might have to select the albums first, then go after the photos for each album. right now all my photos just post to a single iphone album, but soon I will add the ability to create albums. So I need both.

I will post code to, when I figure it out.

Documentation is usable but not great, FQL is a lot like normal SQL so its not to hard to figure out.

The functions return in most cases a NSDictionary Object.
Hi,

I agree about the documentation and samples not being that great.

I need to implement friends.get and photos.get.

Lets see, will be working on both this weekend.

Will keep this thread updated.

Cheers.
Jango is offline   Reply With Quote
Old 12-04-2009, 07:48 AM   #8 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by Jango View Post
Hi,

I agree about the documentation and samples not being that great.

I need to implement friends.get and photos.get.

Lets see, will be working on both this weekend.

Will keep this thread updated.

Cheers.
Someone came up with friends.get , seach this forum, I don't remember exacly who.

As for photos.get

I am 99% done with the codeing, I'll post something over the weekend.

Basically I use fql to get the albums
Display the albums in a uitableView

Then on the objectAtIndex.row.index I call fbconnect passing the uid or aid and the album id. Then display the result set from the NSDictionary in a thumbnail view created using three20 library.

Its a very nice user experience.
michelle is offline   Reply With Quote
Old 12-20-2009, 01:40 PM   #9 (permalink)
indie dev
 
rocotilos's Avatar
 
Join Date: Oct 2009
Posts: 2,754
Default

Hello im looking to do this too.

Basically i need to upload a photo in uncompressed format to facebook, and also need to download from facebook.

for the upload part, i can use the function given by michelle.

Quote:
- (void)uploadPhoto {
// NSString *path = @"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg";
NSURL *aUrl = [NSURL URLWithString:url];
NSData *data = [NSData dataWithContentsOfURL:aUrl];
UIImage *img = [[UIImage alloc] initWithData:data];
NSData* cData = UIImageJPEGRepresentation(img, 1.0);
UIImage *image = [[UIImage alloc] initWithData:cData];

NSDictionary *params = nil;
[[FBRequest requestWithDelegate:self] call:@"facebook.photos.upload" paramsarams dataParamNSData*)image];
NSLog(@"image uploaded");

}
But this method is not standalone right? It needs the FB Connect classes?
rocotilos is offline   Reply With Quote
Old 12-20-2009, 02:03 PM   #10 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by rocotilos View Post
Hello im looking to do this too.

Basically i need to upload a photo in uncompressed format to facebook, and also need to download from facebook.

for the upload part, i can use the function given by michelle.



But this method is not standalone right? It needs the FB Connect classes?
Yes it does.

You need to go to the facebook developer site on facebook.

And follow the iphone info.

You get a developers key and you need to set up a simple facebook app, there is a wizard that walks you through the creation, it quick.

Than you can download the sdk, the examples are very good, follow them. The image code above is derived for there. Than you need to either bring the facebook connect classes in your project, changing the headers as appropirate or statically include the library. I perfer the former but some people don't like bringing in full libraries. I personally take the time to find our what every piece of code my app does. Better to avoid rejections that way.

Once you do that look at the 2nd through 6th or so post on my blog it will give you a major headstart.
As for getting images - you could use the fql like above to download them, or you could just implement a copy to photo album, which I haven't seen before , so I am sharing something I think is unique in my code.After all its christmas, check the blog for how to do it.

Life in The Clouds
michelle is offline   Reply With Quote
Old 03-19-2010, 04:27 PM   #11 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 55
Default

i ve been spending days can't find a solution.
please if you know how to use photos.get i would be really thankful..
themaster is offline   Reply With Quote
Old 03-19-2010, 06:24 PM   #12 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 185
Default

Quote:
Originally Posted by themaster View Post
i ve been spending days can't find a solution.
please if you know how to use photos.get i would be really thankful..
I don't understand where the problem is, the info I gave you should of been enough to upload, download and view photos.

If you can explain were the problem is or better yet provide me with the view controller or xcode project I will try to find some time to look at it.

Otherwise follow my lazy load blog entry.
michelle is offline   Reply With Quote
Old 03-21-2010, 08:16 AM   #13 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 55
Default

1st of all thank you so much for spending time to answer though the post is old
2nd of all at this point i have no code and what was written was upload only
i have a problem i don't want to upload ,here is what i want to do ::
i wanna be able to get the profile picture of my own and my friends that's all for simplicity let's talk about my own photo how can i do that what should i write in the query and in the request?????
for example if you have played the game who has the biggest brain you 'd notice that they displayed the profile pictures of you and your friends with scores sorted....
thank you for your time a lot ......
themaster is offline   Reply With Quote
Old 06-08-2010, 03:39 AM   #14 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 13
Default

Quote:
Originally Posted by themaster View Post
1st of all thank you so much for spending time to answer though the post is old
2nd of all at this point i have no code and what was written was upload only
i have a problem i don't want to upload ,here is what i want to do ::
i wanna be able to get the profile picture of my own and my friends that's all for simplicity let's talk about my own photo how can i do that what should i write in the query and in the request?????
for example if you have played the game who has the biggest brain you 'd notice that they displayed the profile pictures of you and your friends with scores sorted....
thank you for your time a lot ......
hello .... hope you are done with your task.... i have a little similar to this problem i.e. i have an image and i want to set that image as a user profile image any idea how can i do that ??? or i have an image url and want to update the profilepicture url ???
yunas is offline   Reply With Quote
Old 06-30-2010, 06:25 PM   #15 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 2
Default

Quote:
Originally Posted by michelle View Post
Hi Michelle-
I realize that this is kind of an old forum topic, but I had a question for you.
Have you seen anything like these examples for the video.upload method call?

I am having a terrible time trying to implement it one of my apps. Any help would be appreciated.

Thanks.
cpyatt05 is offline   Reply With Quote
Old 07-01-2010, 03:20 PM   #16 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 2
Default

Nevermind, I figured it out.
cpyatt05 is offline   Reply With Quote
Old 10-05-2010, 03:28 AM   #17 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 3
Default

Quote:
Originally Posted by cpyatt05 View Post
Nevermind, I figured it out.
mind posting some sample video uploading code?
pogitalonx is offline   Reply With Quote
Old 10-05-2010, 07:15 AM   #18 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 51
Default

I'd like to add to this , who knows someone might find it useful.

Go to this link
Software Development blog by Aman FacebookAgent: Easy way to integrate facebook connect in iPhone Apps and write minimum code to publish feed, change status etc!

The following wrapper class is easy to use and the best thing about this is that you don't need to change xcode settings every time you want to incorporate FB Connect Api in your project.
baltar is offline   Reply With Quote
Old 10-05-2010, 11:54 AM   #19 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 66
Default

or use ShareKit :

ShareKit : Drop-in Share Features for all iOS Apps

hatembr is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 263
22 members and 241 guests
@sandris, AdamL, ADY, Dani77, diyora, FAED, fredidf, F_Bryant, GHuebner, HDshot, headkaze, mer10, Oral B, prchn4christ, Rudy, smithdale87, stekki, tgjorgoski, Thompson22, Touchmint, twerner, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,752
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:00 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0