How can I add a specific email recipient to my sharekit item? - iphone

So, I'm using sharekit to share some text. I need to be able to send the email to a pre-defined recipient. How can I set the mail recipient to the sharekit item?

Sharekit has now implemented this. You can use the example below.
NSURL *url = [NSURL URLWithString:#"Your URL"];
SHKItem *item = [SHKItem URL:url title:#"Your title" contentType:SHKURLContentTypeUndefined];
NSArray *recipientArray = [NSArray arrayWithObjects:#"mail#example.com",nil];
[item setMailToRecipients:recipientArray];
[SHKMail shareItem:item];

I found the answer here:
ShareKit
UPDATE: Sharekit has an update that takes care of this now. See the newly accepted answer.

Related

Open the Phone (Call) with a button and a Text field/View (iPhone) and come back to the application back

Hello, I have successfully developed an application in which clicking on UIButton the Mobile no in UITextField dialled.
But I am not able to come back in my application. Is it possible to come back on the page from which I have dialled the Mobile number.
-(void)newuser:(id)sender;
{
NSString *URLString = [#"tel://" stringByAppendingString:#")172-123456"];
NSURL *URL = [NSURL URLWithString:URLString];
[[UIApplication sharedApplication] openURL:URL];
}
Thanks
No, an application receiving a URL to process doesn't get information about the sender. Besides, as far as I know the Phone application doesn't have a Back button either.
not sure which iOS version this was implemented in but I use this simple approach in my latest app 'App Time' which is to launch the call from within a UIWebview, but doesn't require anything more than...
UIWebView *webView = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:#tel://yourNumber"];
[webView loadRequest:[NSURLRequest requestWithURL:telURL]];
the user is prompted to confirm the call with a UIAlertview but will be brought back to the same screen after the call completes.

How to register an app to respond to a custom URL scheme opening request?

Like this:
NSString *stringURL = #"appname://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
I slightly remember it was necessary to write a value-key to Info.plist. How?
Add this to plist .
The app will by called by #"readtext://" url
This seems to be the question that I answered (with screenshots & source code) here.
And I've posted a full walkthrough of how to do this on my blog.

How to implement sharing via Twitter, mail & Tumblr using ShareKit

I am trying to use ShareKit to implement sharing via Twitter, mail & Tumbler but I am unable to make them work correctly.
I implemented the following code on view load,
SHKItem *item;
item=[SHKItem image:[UIImage imageNamed:#"icon2.png"] title:#"Praveen"];
[SHKFacebook shareItem:item];
Please help me..
Try these following lines ;) it works for me :)
NSString *imageName=[NSString stringWithFormat:#"marriage0.jpg"];
NSString *message=[NSString stringWithFormat:#"%#",self.myMessage.text];
UIImage *image =[UIImage imageNamed:imageName];
SHKItem *fbItem = [SHKItem image:image title:message];
[SHKFacebook shareItem:fbItem];

ShareKit for Facebook in iPhone application

I can't get ShareKit to work. I dragged ShareKit into my app with checked copy option. I also updated the shkconfig file with my Facebook key, secure key, and used the following code:
SHKItem *item = [SHKItem text:#"Praveen Kumar Tripathi"];
SHKFacebook *faceBook=[SHKFacebook shareItem:item];
[faceBook share];
in viewDidLoad.
But I'm not able to see Facebook screen. I'm seeing a blank screen.
You weren't completely clear, so I'm not sure what your asking, but it sounds like you want to show a facebook login at launch. The way you do that is like this:
First, #import "SHKFacebook.h"
then in your button, put then in the viewDidLoad:
SHKItem *item;
this creates the sharekit item
then:
NSURL *url = [NSURL URLWithString:#"http://itunes.apple.com/us/app/...?mt=8"];
put the link to your app here. This link is so if someone clicks on the Facebook post, they will be directed to the iTunes store to download your app.
Then set the basic text for your post. This text is set by you. The user Cannot change this text. (Obviously this is what I do, you can make this text anything you want)
item = [SHKItem URL:url title:[NSString stringWithFormat:#"I'm playing someGame on my iPhone! My Highscore is %i, think you can beat it?", highScoreInt]];
Then set up the post like this:
item = [SHKItem URL:url title:#"Share Me!"];
finally show the item:
[SHKFacebook shareItem:item];
I hope this helps.

SMS body in iphone SDK

I need to send an SMS from my iphone app. the body of the SMS is created programatically. so when i tap on a button the SMS application should get opened with my message pre-typed in it. anybody knows how to do it? need help
Thanks in advance.
Shibin
You can't set the SMS body. The only things you can do from your code, as per the official SDK, is 1) to open the SMS application:
NSString *stringURL = #"sms:";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
and 2) to set the phone number for a new message:
NSString *stringURL = #"sms:+12345678901";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
You can set the body in iOS 4. Please cf the documentation.