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 09-26-2010, 09:46 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 2
cawaker is on a distinguished road
Default Facebook Connect, NSString in NSDictionary?

I'm trying to pre-populate the attachment section of a facebook publish feed with the following NSStrings. My goal is to pre-populate with some dynamic data like a time interval, just like how games do with the high score or something, the FB window pops up with the highscore all ready for the user to hit submit.

Code:
[NSString stringWithFormat:@"%d weeks",[components  week]];
compday.text = [NSString stringWithFormat:@"%d days",[components  day]];
here's the FBconnect section where it should go. I think, Maybe i'm way off base on how to autofill in info on a FB wall post.

Code:
- (IBAction) publishStream: (id)sender {
  
  SBJSON *jsonWriter = [[SBJSON new] autorelease];
  
  NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
                               @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil];
  
  NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
  NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                               @"a long run", @"name",
                             @"prepopulate text here", @"caption",
                               @"it is fun", @"description",
                               @"http://itsti.me/", @"href", nil];
  
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
  NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                 kAppId, @"api_key",
                                 @"Share on Facebook", @"user_message_prompt",
                                 actionLinksStr, @"action_links",
                                 attachmentStr, @"attachment",
                                 nil];
  [_facebook dialog: @"stream.publish"
          andParams: params
        andDelegate:self];
  }
the NSString is time interval components so I'd like to populate the FB message with the time intervals, and they change daily, it's not static text like the NSDictionary has listed.

so basically how would i integrate a dynamic NSString calc into the FB connect attachment publishing code?

Last edited by cawaker; 09-26-2010 at 10:24 PM.
cawaker is offline   Reply With Quote
Old 12-08-2010, 04:25 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2010
Posts: 3
Twig is on a distinguished road
Default

I'm stuck in the same place. Have You managed to solve this problem?
Twig is offline   Reply With Quote
Reply

Bookmarks

Tags
facebook connect, nsdictionary, nsstring

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: 349
7 members and 342 guests
headkaze, mistergreen2011, nobstudio, Objective Zero, revg, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

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