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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 03-05-2011, 01:59 AM   #1 (permalink)
Registered Member
 
djalfirevic's Avatar
 
Join Date: Mar 2011
Posts: 84
djalfirevic is on a distinguished road
Default Facebook API - couple of questions

Hello,

I'm developing an iPhone app which has to integrates Events creation on Facebook. Regarding that, I have a couple of questions and I hope that you will help me. If some of these questions are already been answered, my apology, but I had no luck with searching the forum.

1) I had to integrate ShareKit in my project because I need Twitter action as well, but in Facebook folder there are FBSession and all other classes for FBConnect. Question: which version of FBConnect is better to use, one with the Facebook class, or one with the FBSession class?

2) Is it possible to create an event with FBSession version?

Code:
NSString *eventString = [NSString stringWithFormat:@"{\"name\":\"Test Event\",\"start_time\":\"1215929160\",\"end_time\":\"1215929160\",\"location\":\"SomeWhere\"}"];
NSDictionary *params = [NSDictionary dictionaryWithObject:eventString forKey:@"event_info"] ; 
[[FBRequest requestWithDelegate:self] call:@"facebook.events.create" params:params];
I can't make this work in that version. When I tried with the version which has Facebook class, then I put:

Code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
								   @"My Test Event", @"name", 
								   @"2011-03-14", @"start_time",
								   @"2011-03-15", @"end_time",
								   @"privacy", @"SECRET",nil];
	
	MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication].delegate;
	[appDelegate.facebook requestWithGraphPath:@"me/events" andParams:params andHttpMethod:@"POST" andDelegate:self];
That seemed to work. I actually created an event. I want to use FBSession version because, there I have FBLoginButton class and then I avoid using Safari because of [facebook authorize]; method.

If you suggest me to use version which has Facebook class in it, how to put venue in dictionary? I have a trouble reading Facebook API documentation. There it says:

"venue: A JSON object containing street, city, state, zip, country, latitude, and longitude fields"

How to store it in NSMutableDictionary?

Thanks.
djalfirevic is offline   Reply With Quote
Old 04-22-2011, 02:17 PM   #2 (permalink)
Crafty Veteran
 
Magic Hands's Avatar
 
Join Date: Nov 2008
Location: Memphis, TN
Age: 23
Posts: 436
Magic Hands is on a distinguished road
Send a message via Skype™ to Magic Hands
Default

**EDIT**
The code above works fine.
__________________

Last edited by Magic Hands; 04-22-2011 at 03:21 PM. Reason: **Edit** The code above works fine.
Magic Hands is offline   Reply With Quote
Reply

Bookmarks

Tags
event, facebook, facebook api, fbrequest, fbsession

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: 371
17 members and 354 guests
Absentia, akphyo, apatsufas, BinHex, dre, Error404, fredidf, Gaz, gmarro, jeroenkeij, Kirkout, MarkC, mottdog, Music Man, PavelMik, whitey99, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

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