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-07-2011, 03:34 AM   #1 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default Facebook Sharing... The right strategy..

Hello everyone,

first of all i have never worked with facebook before and out there is an ocean of information most of them useless, so i need your opinion/knowledge/experience.

I need to update one of my apps so it can share on the Facebook. I need to share a small image, a title, a small text and a link. I have seen other apps can do it but its a bit confusing.

I tried Sharekit but it seems its not what i need cause Actionsheet can only take one argument.

Does anyone know how can i do that, or give me a go to the right direction?

Thank you,
Marketshow
marketshow is offline   Reply With Quote
Old 09-07-2011, 04:14 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

what about using sharekit, with the method
Code:
+ (SHKItem *)image:(UIImage *)image title:(NSString *)title;
and put link and text on title parameter
__________________
dany_dev is offline   Reply With Quote
Old 09-07-2011, 04:57 AM   #3 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
what about using sharekit, with the method
Code:
+ (SHKItem *)image:(UIImage *)image title:(NSString *)title;
and put link and text on title parameter
First of all thank you for your reply Dani.

I have already tried that but after i concat the title and the text with the
Code:
stringByAppendingString
it all comes as one. I would like the title to come in bold at least.

And furthermore, sharekit creates an album to the user.. I dont know if they r gona like it! I dont think i would like it for an app i use!

Consider my app as a newspaper with articles that i would like to share.

Thanks again,
Marketshow
marketshow is offline   Reply With Quote
Old 09-07-2011, 05:11 AM   #4 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default Example

In fact i want that!!
marketshow is offline   Reply With Quote
Old 09-07-2011, 05:35 AM   #5 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

That's done by sharing an URL I think. Facebook pulls all the info from it, page title, picture and partial text. I don't think you can manually choose and set those elements.
baja_yu is offline   Reply With Quote
Old 09-07-2011, 06:01 AM   #6 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default

Thank you for the reply baja_yu.

The URL sharing through ShareKit didnt get the job done. It gets the link in the title but not the img and the text.

I know it can be done, the pic i posted is from an iPhone App but maybe it cant be done through ShareKit. Any other thoughts? Maybe another way i can shaer those things?


Thank u in advance,
Marketshow
marketshow is offline   Reply With Quote
Old 09-07-2011, 07:27 AM   #7 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Bangkok, Thailand
Posts: 33
mr3cho is on a distinguished road
Default

Quote:
Originally Posted by marketshow View Post
Thank you for the reply baja_yu.

The URL sharing through ShareKit didnt get the job done. It gets the link in the title but not the img and the text.

I know it can be done, the pic i posted is from an iPhone App but maybe it cant be done through ShareKit. Any other thoughts? Maybe another way i can shaer those things?


Thank u in advance,
Marketshow

I'm got this working by modifying colinhumber's sharekit fork (https://github.com/colinhumber/ShareKit). Great work by colinhumber btw!

The image and description for the link are extracted from the websites meta tags btw.

I replaced the following code in SHKFacebook.m class...
Code:
- (BOOL)send {
	if (item.shareType == SHKShareTypeURL) {
        
		NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
									   [item.URL absoluteString], @"link",
									   item.title, @"name",
									   item.text, @"caption",
									   nil];
		
		if ([item customValueForKey:@"image"]) {
			[params setObject:[item customValueForKey:@"image"] forKey:@"picture"];
		}
		
		[self.facebook requestWithGraphPath:@"me/feed" 
								  andParams:params 
							  andHttpMethod:@"POST" 
								andDelegate:self];

with this...
Code:
 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
									   [item.URL absoluteString], @"link",
									   item.title, @"name",
                                       item.text, @"message",
									   nil];
		
		[self.facebook requestWithGraphPath:@"me/links" 
								  andParams:params 
							  andHttpMethod:@"POST" 
								andDelegate:self];
so it posts to me/links instead of me/feeds

also modify SHKSharer class to include a message: param on the shareURL method if you want to include a message.

Code:
+ (id)shareURL:(NSURL *)url title:(NSString *)title message:(NSString *)message;
mr3cho is offline   Reply With Quote
Old 09-07-2011, 08:12 AM   #8 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default

Thank you mr3cho,

i will try this and report back!
marketshow is offline   Reply With Quote
Old 09-08-2011, 03:40 AM   #9 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default

Hello again,
had a problem with

Quote:
"Cannot Open Page Safari can not open the page because the address is invalid"
but i fixed it but editing the info.plist.


Thank you mr3cho you have been of great help...

My only thing now is that the pic doesn't come right. Its a wrong image. I probably should speak with website administrator about the websites meta tags you mentioned above!

Thank you,
Marketshow

Last edited by marketshow; 09-08-2011 at 04:49 AM.
marketshow is offline   Reply With Quote
Old 09-12-2011, 06:00 AM   #10 (permalink)
myCustomUserTitle
 
marketshow's Avatar
 
Join Date: Dec 2010
Location: Athens
Age: 27
Posts: 79
marketshow is on a distinguished road
Default

I am still having problem about the picture.
mr3cho mentioned the website meta tags but my site administrator cant help me. The web-page has multiple images and i cant extract the one i want.

Has anyone a hint or experience on that certain subject?


Edit:
Finally i think its all about the websites meta-tags.
Here are some links that may help somebody in the future :

http://moserlx.com/2011/09/facebook-...-tags-806.html

https://developers.facebook.com/docs/opengraph/

Last edited by marketshow; 09-14-2011 at 03:34 AM.
marketshow 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: 379
8 members and 371 guests
apatsufas, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

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