I would like to call other facetime numbers, but these are emails and not numbers. How do I do it?
For numbers, I know what to use.
NSURL *url = [NSURL URLWithString:#"facetime://+123456789"];
[[UIApplication sharedApplication] openURL:url];
But for emails, how do i change it. Any idea?
NSURL *url = [NSURL URLWithString:#"facetime://email#example.com"];
[[UIApplication sharedApplication] openURL:url];
These are the options
#"facetime://appleId" // For apple id
#"facetime://email#example.com" // For email id
#"facetime://5558675309" // For phone number
Related
There is an iOS 5.0+ app, released in App Store, which displays employees profiles with their phone numbers. The users of the app can tap on the phone number and the number will be dialed on their iPhones.
The problem is that some users with iPhone 4 are reporting that it does NOT dial.
This is the code I am using to dial:
NSString *cleanedString = [[self.member.phone componentsSeparatedByCharactersInSet:[[NSCharacterSet characterSetWithCharactersInString:#"0123456789-+()"] invertedSet]] componentsJoinedByString:#""];
NSString *escapedPhoneNumber = [cleanedString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *urlText = [NSURL URLWithString:[NSString stringWithFormat:#"tel://%#", escapedPhoneNumber]];
[[UIApplication sharedApplication] openURL:urlText];
Any ideas about this?
There shouldn't be any / in the tel: scheme:
NSURL *urlText = [NSURL URLWithString:[NSString stringWithFormat:#"tel:%#", escapedPhoneNumber]];
In the Apple URL Scheme Reference you can see some example for what is allowed in the tel: scheme.
If you use telpromt instead of tel this will return you to app after your call ends|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"telprompt:1234567890"]];
i am working on signup feature. In this feature when the user create account successfully. i am asking him or her to activate his account.
i want to open the mail application of iphone if user say yes.
now my question is simple how to open mail application from my own application?
#define URLEMail #"mailto:sb#sw.com?subject=title&body=content"
NSString *url = [URLEMail stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding ];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
Try this out.
-(void)launchMailAppOnDevice
{
NSString *recipients = #"mailto:myemail#gmail.com?subject=subjecthere";
NSString *body = #"&body=bodyHere";
NSString *email = [NSString stringWithFormat:#"%#%#", recipients, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}
stringByAddingPercentEscapesUsingEncoding and openURL are deprecated.
Now use this:
#define URLEMail #"mailto:sb#sw.com?subject=title&body=content"
NSString * encodedString = [URLEMail stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
UIApplication *application = [UIApplication sharedApplication];
[application openURL:[NSURL URLWithString: encodedString] options:#{} completionHandler:nil];
Ahoy!
The long and short of it is; you can't.
You can create an email compose view for the purpose of sending emails (see MFMailComposeViewController), but you cannot open applications arbitrarily without a purpose.
See this previous post for clarification: Launch an app from within another (iPhone)
Really though, it's not much effort for the user to close your app and open Mail so I wouldn't worry too much about it anyway.
Currently I am doing this to 'get directions':
NSString *googleMapsURLString;
googleMapsURLString = [NSString stringWithFormat:
#"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f",
curLoc.latitude, // Start
curLoc.longitude,
self.hotspot.coordinate.latitude,
self.hotspot.coordinate.longitude];
NSLog(#"Opening URL: %#",googleMapsURLString);
NSURL *url = [NSURL URLWithString:googleMapsURLString];
[[UIApplication sharedApplication] openURL:url];
Does anyone know if there is a parameter to get directions via walking instead of defaulting to driving?
Just add
dirflg=w
to your parameters.
Hai
I am developing a new application. In that send a message to pre configured numbers and the user selecting numbers. How it is possible? when then send button is pressed. Please help. Can any give me some Sample code or tutorial.
Thank You
Please read the below SO post,
How to send SMS and number from contacts?
Here is link could help you ...
http://iosdevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
SMS
To open the SMS application, just use the sms: protocol in your URL:
NSString *stringURL = #"sms:";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
You can specify a phone number, but apparently not a default text for your message:
NSString *stringURL = #"sms:+12345678901";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
NSURL *url = [NSURL URLWithString:#"facetime://+123456789"];
[[UIApplication sharedApplication] openURL:url];
In the above code "123456789" is a inbuilt iPhone no or our own phone number?
Thanks,
Vadivel
It's the phone number that you want call.