Sending Text and Image in one Email via ShareKit - iphone

In iPhone App I want to send Image and Text together in single Email Using ShareKit
is it possible to do so?
If yes, How can it be done?

This is what I use:
SHKItem *item = [SHKItem image:myImg title:#"My Awesome Image!!!"];
item.text = #"Look at this awesome Image";
[SHKMail shareItem:item];
and it works well!

ShareKit doesn't seem to have very comprehensive documentation, but from what I could find, it seems your best bet is to share an image and include your text as the title - as an e-mail, this should just work as 'sending an image with text'.

Related

share text on facebook from iOS application using sharekit

I want to share some text on facebook using sharekit. I found many solutions but no1 worked for me.
I have imported sharekit and frameworks in my project. Now I want to share text: #"Hello everyone" directly (I mean not to choose from options: mail, twitter, facebook. When I press button share it should share text on facebook, of couse ask log in if it's necessary).
And also I will be glad if you tell me which fields are necessary to fill in the SHKConfig.h file for facebook.
In DefaultSHKConfigurator.m replace the defaultFavoriteTextSharers method with the below Code
- (NSArray*)defaultFavoriteTextSharers {
return [NSArray arrayWithObjects:#"SHKFacebook", nil];
}
Sharing Text
+ (SHKItem *)text:(NSString *)text;
//text - The text you want to share
NSString *someText = #"This is a blurb of text I highlighted from a document.";
SHKItem *item = [SHKItem text:someText];
You can download the ShareKit source files and just watch the ShareKit official project overview video here
You can read the ShareKit documentation here

Internal linking to app page on iphone

Hi similar to the facebook and iphone app, i have an # function which should link to the users page. My question is how do i go about doing this, what control should be used, for instance i may have some text like this;
"hey #pablo are you and #paul coming over tomorrow"
In that text #pablo and #paul should be clickable.
I hope i am making sense?. Thanks
I have written an article on an interactive rich text UILabel and included full source-code... enjoy!
As promised article is here.....
You can use a uiwebview to do it and add the text with html to the webview.

detecting URL and format it in UITextField

I would like to be able to format a URL in my UITextField nicely. So say the text of the UITextField is
textField.text = #"Hi this is a page for my website http://www.mywebsite.com";
I would like it to automatically underline this mark it as a hyperlink and when a user taps on the link it opens up the site. This is similar to any twitter client that you have out there (tweetdeck, tweetbot, etc). How do I do this the easy way?
You can use a UITextView instead and set the dataDetectorTypes property to the types of links you want to be able to handle.
hey this is really simple, you can set the UITextFiled to detect Links, like so:
myTextView.dataDetectorTypes = UIDataDetectorTypeAll
check out my tutorial on this at my site for more info
http://www.sdkboy.com

iOS ShareKit, twitter logout? facebook status empty?

I am using ShareKit plugin for iPhone to enable social sharing for the application I'm working on. I set up everything, I stripped it to have Facebook and Twitter services only, connected successfully to both and now I have 1 problem in each of the services...
The problem with Twitter is how to logout/signout...
ShareKit sends the text and the url to Twitter's publish box. It is saving status perfectly. The question is where to put "logout" button for twitter? I want the iPhone user to logout in order to change username. This is done by calling the method
[SHKTwitter logout];.
Now, the problem is where to put the button that will fire this method? In navigationToolbar of Twitter actionSheet I already have 2 buttons and the toolbar (bottom one) is covered by the keyboard?
[EDIT]: I solved this issue by modifying the twitter action sheet. I resized the textView and then added UIToolbar and changed its position so that it fits into the gap between the keyboard and textView. Into the toolbar I added one button with an action that calls a logoutTwitter method
Facebook problem is more of a mystery...
So, in my sharreKitButtonHandler I have the following code:
NSURL *url = [NSURL URLWithString:#"http://www.domain.com"];
SHKItem *shareItem = [SHKItem URL:url title:self.itemTitle.text];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:shareItem];
[actionSheet showFromToolbar:self.shareKitToolbar];
This code prepares some ivars of a shareItem object and in the case of Twitter shareKit manages to fill the status box so that user just needs to press publish and its done...
In the case of Facebook it is not working. FB dialog pops out and the share box is empty saying "What's on your mind?" The url and the title are not put into the publish form?
So, please if you have any clue what's going on in the latter problem or how to solve the former problem, I would really appreciate your help...
It takes five lines to add twitter. I wouldn't bother with Sharekit for that.
TWTweetComposeViewController *tweetView = [[TWTweetComposeViewController alloc] init];
[tweetView addImage:imageToShare;
[tweetView addURL:URLToShare];
[tweetView setInitialText:messageToShare];
[senderViewController presentViewController:tweetView animated:YES completion:nil];
I wanted to use sharekit for my projects, but it was difficult to use and after a week I gave up as I couldn't share more than one thing at the same time (URL, Image, Message, etc.) which is pretty useless if you want to promote your app.
Facebook is more difficult, probably a 100 lines. It took me 3-4 days to implement. It will be integrated in iOS 6 just like Twitter :)

Getting Error While sending an image From an iPhone emil using MailComposer

I am using MailComposer available in iPhone sdk3.0.
I am using the following code to add image using html to my email body. It displays the image properly in mail body. But when I try to send it. It breaks leaving message in the log , No image found. Can anyone help me regarding this where am going wrong. Like I also tried attaching the images, but it wasnt working. It does display the images in the composer but breaks while sending.
UIImage *tempImg = [self getSmallImage:[dbPersistenceObj getImage:[[imageIdArray objectAtIndex:i] intValue]]];
NSData *imageData = UIImageJPEGRepresentation(tempImg,1);
NSString *encodedImage = [self base64EncodingWithLineLength:[imageData length] data:imageData];
emailBody = [emailBody stringByAppendingFormat:#"<b><img src='data:image/jpg;base64,%#' alt='64 bit image'/></b>", encodedImage];
tnx.
data: URLs are not supported when sending email. Upload the image to a central server and then link to that using a standard <img src="http://example.com/image.jpg" /> tag
Just tested with 3.1 - works like a charm!
"data: "URLs are definitely supported in 3.1 when sending email with the MFMailComposeViewController!