I have developed one application which use Skype URI for dial the tel number.
NSString* stringURL = [NSString stringWithFormat:#"skype:%#", strTel];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:stringURL]];
But the Skype URI doesn't work.
I remembered it worked before.
Now, it only opened Skype, and nothing happens (It used to dial the tel number before).
I checked the skype document, but seems nothing change.
Did I miss anything?
Please help me to solve this issue.
PS: I already added the key LSApplicationQueriesSchemes in Info.plist file for skype
Firsly check skype is in your device or not. You can use below code for Skype and check real device.
BOOL skypeInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"skype:"]];
if(skypeInstalled){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"skype:echo123?call"]];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"https://itunes.apple.com/in/app/skype/id304878510?mt=8"]];
}
Or Use as this
NSString* urlString = [NSString stringWithFormat:#"skype:USER_NAME?call"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]];
Related
I have my old application which is working fine till iOS 8.2. In one button action I have to open safari using openUrl and this is working fine for the device with iOS 8.2. But when I run it in iOS 8.3 then its not opening the safari and when I tried to print it then its returning NO.
Is there any change in iOS 8.3 for openUrl method?
Edit 1:
NSString *loginUrl=[object sighnUpUrl];
NSLog(#"%d",[[UIApplication sharedApplication] openURL:[NSURL URLWithString:loginUrl]]);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:loginUrl]];
I am just using the url of login page of my web.
Edit 2:
NSURL *url = [NSURL URLWithString:#"http://www.stackoverflow.com"];
if (![[UIApplication sharedApplication] openURL:url]) {
NSLog(#"%#%#",#"Failed to open url:",[url description]);
}
I tried the same code and getting Failed to open url:http://www.stackoverflow.com.
Edit 3:
NSURL *URL = [NSURL URLWithString:#"http://www.google.de"];
if ([[UIApplication sharedApplication] canOpenURL:URL]) {
[[UIApplication sharedApplication] openURL:URL];
}
When I tried the same above code then its entering the if block but still unable to the safari.
Note: All the above Codes are working in iOS 8.2.
this is the way to go:
NSURL *URL = [NSURL URLWithString:#"http://www.google.de"];
if ([[UIApplication sharedApplication] canOpenURL:URL]) {
[[UIApplication sharedApplication] openURL:URL];
}
Check this
NSURL *url = [NSURL URLWithString:#"http://www.stackoverflow.com"];
if (![[UIApplication sharedApplication] openURL:url]) {
NSLog(#"%#%#",#"Failed to open url:",[url description]);
}
Please try this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.google.com"]];
Edit:
BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:yourURL];
Try to place your URL here & check whether it returns True or False.
I have gone through all the answers and I know all of them will work.The issue was on the other side.I am using Mobile Device Management in my app.Some one from the server side had disabled safari using MDM.Unfortunately for the device with iOS 8.2 it was enabled and for the devices with iOS 8.3 it was disabled which made me think its an iOS issue.So while safari is disabled using MDM it can't open any url.My Bad.Thanks for all your answers.
ios8.3 .apk file received by e-mail, can not open other applications, it may be a BUG ios8.3 of
I have the following code in my iOS app, attempting to open up a user's Facebook page in the app:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:#"fb://profile/%#",fbidStr]];
[[UIApplication sharedApplication] openURL:url];
if ([[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication] openURL:url];
}
else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"https://www.facebook.com/%#",fbidStr]]];
}
When the app opens, I get an error 'The page you requested was not found'. I've NSLogged the URL and it looks fine:
fb://profile/10154531xxxxx65245
And everything works fine when the user doesn't have the app installed and views the profile in safari.
What could be wrong here?
I've had the some problem, it seems that Facebook only accepts on their profile module people that are already friends with you.
I'm working on iOS application. Here is the code i used
NSURL *url = [NSURL URLWithString:#"fb://page/5718758966"];
if ([[UIApplication sharedApplication] canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url];
}
else
{
//Open the url as usual
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"https://facebook.com/5718758966"]];
}
As I mentioned, this code has worked to open Facebook app but shows blank page; my question is if there is an alternative link I can use that will both open the app and direct the user to this specific page, or is this simply a Facebook bug?
Thanks!
Instead of "fb://page/5718758966" try "fb://profile/5718758966" for your URL.
I was trying to open the Facebook app with particular Facebook page from my app with the following code:
NSURL *url = [NSURL URLWithString:#"http://www.facebook.com/pagename"];
[[UIApplication sharedApplication] openURL:url];
When I click on the button it opens the Facebook app but the required page doesn't load or show.
Is there any other way to open the Facebook app with particular Facebook page? Please correct me If I am doing something wrong.
Thanks in advance.
To open the facebook app directly you should do the following:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString: #"fb://profile/PAGE_ID"]])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"fb://profile/PAGE_ID"]];
}
else
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://facebook.com/PAGE_NAME"]];
}
This is a solution including a fallback for web.
To determine your PAGE_ID you could use a service like this.
Is this is the only way to open a dialer to call or msg.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel:+%#",phoneNumber]]];
if yes. then will this support from ios3 to ios6 (beta).
if no. then can any one please give some sample code.(if any private api can do this pls mention it)
if separate functions are available for sending sms and calling a number, please let me know that too.
in ipad 1 with ios 4.2.6, the following codes are not working
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"sms:9190432097420"]]];
and
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:#"tel:9190432097420"]]]
Wr does the problem lies
According to UIApplication's Class Reference, the openUrl: method is available in iOS 2.0 and later. So you should be safe to use that method.
With regard to your example, it's 'safer' if you first check if there is an application that can handle the provided url. For instance:
NSURL *url = [NSURL URLWithString:#"tel:9190432097420"];
if([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
else {
NSLog(#"No application for url '%#'", url);
}
Are you testing on an actual device or in the simulator? The simulator does not support this as far as I've seen.