iphone emulator URL schema for phone call - iphone

I'm new to iPhone dev. I could solve most of my problem reading stackoverflow/apple doc, but now I'm kind of stuck.
I'm trying to make a phone call from a phone number.
from the doc and example I found, I made this:
// "9312345678"
-(void) doCall:(NSString*) phoneNumber{
DsLog(phoneNumber);
NSString * s = [NSString stringWithFormat:#"tel:%#",phoneNumber];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:s]];
}
This do nothing ! (no exception, no dialgo, no phone call)
Did I did something wrong? Is it because it's the emulator?
any help appreciated,
Loda
PS: I got something similar to open the browser, and it's working fine; The log show in the debugger console with a valide phone number.

btw its tel:// not tel:
But it does not work in the simulator.
If you want to see what handlers work, you can open up the simulator and safari (within the simulator) and then try it out. You can also do it from a real phone.

Related

How to send my app in foreground after a Facetime (integrated) call?

I'm trying to integrate Facetime in my app so basically what I would like to do is to press a button making a call and when it finishes come back to my app. I know that for the time being there are no public API for Facetime.
What I'm doing at the moment is to use Facetime scheme:
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: #"facetime://"]];
I have two questions:
Is it possible to use in the openURL above the string "facetime://" in order to choose who I want to call in Facetime?! I tried it but what happens is that Facetime is run but without its layout so basically I see myself on the screen but I cannot do nothing.
If not point 1 therefore I use for example "facetime://steve#apple.com" is it possible to come back to my app once the call is finish?! I read about multitasking but I don't know how to manage it in this situation.
Thanks in advance
Alex
To anser your second question, NO just like when your app start a call there is no way to get your app back in the foreground after you close the call.
For your first question, you need to add the contact data (e-mail or phonenumber).
Also be aware that the facetime:// url scheme will work on any iPhone/iPod Touch even if they can't do facetime. If the device does not have facetime support it will just show a blank screen.

iPhone Linking to an iTunes page

I found a page (http://itunes.apple.com/linkmaker) to get the iTunes url for a specific page which I assume should direct the user out of my app and into the corresponding page in the app store.
I have never done this or any other UIWebView stuff but after some searching I found some code that I thought would work that uses UIApplication.h.
My code is:
#import <UIApplication.h>
//...in a tableView....
case 8:
- (BOOL)openURL:(NSURL *) http://itunes.apple.com/us/app/lockbox-pro/id288460603?mt=8&uo=4;
break;
openURL has an error saying that it is undeclared - but I imported the UIApplication.h file. Then I saw that the UIApplication import also had an error on it. I don't think that I want to use UIWebView because from what I understand, that opens up the URL in the app itself - I want to direct the user to the App Store. Where am I going wrong?
EDIT: Okay, I changed it to a simple button that is supposed to close the app and bring the user to the itunes page:
- (IBAction) pressedFull {
[[UIApplication sharedApplication] openURL:[NSURL urlWithString:#"http://www.google.com"]];
}
I linked it in IB - it still crashes the app when the user clicks on it.
Your code has a number of things wrong in just one line. First, you're typing the method signature rather than using the method properly (ie, sending a message to an object). Second, you're not enclosing the string.
Try this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://yoururlhere"]];
With respect, you should review the Learning Objective-C: a Primer thoroughly until you are more comfortable with the syntax as well. A quick look at some of your other questions suggests this is your biggest issue. You'll be doing yourself a huge favor by setting all else aside and concentrating on getting Objective-C well and truly under your belt before continuing.

How can i make phone calls from my application?

i want to make an application which makes phone calls.i am new in this field.Please give some guide lines.
The URL scheme format (according to the Apple URL Scheme Reference) is tel: NOT tel://. While the latter works now, it is not consistent with Apple's documentation and may not work in the future. Aside from that detail, Noah's and mihirpmehta's suggestions are the correct way to initiate a phone call from within your app. Keep in mind though, that your app will quit when the phone app is launched so you may want to save state before opening the URL.
use
[[UIApplication application] openURL:[NSURL URLWithString:#"tel://8005551212"]];
It will only work in iphone... not in simulator...
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://5558675309"]]

How to find a call is unanswered in iphone

If i make a call from an application using
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://1234567890"]];
How can i check if the call is answered or unanswered
Thanks,
You cannot check this. When this URL is opened your application will be closed and phone app will be launched. Since you cannot access calls data from your app there is little you can do. This may be possible in jailbroken iPhone.
Pop up a dialog when the app re-opens asking the user if the call went through. You better have a good reason for wanting to know though or the user will be mighty annoyed!
Otherwise you are out of luck.
Not an iPhone app developer but is it possible to query the phone log the next time the app loads and check time on call or something and if it is over 20 seconds consider it completed or something like this?
There is no access to the iPhone phone from third party software. Luckily.
you can reffer
How can I check missed call in iPhone using Objective-C?

How do you prompt the user to rate your iphone app without waiting for them to delete the app?

I am referring to the popup window that asks the user to submit a review/rating.
I know it can be done since the Aardark app does it...it asks several times in fact! (Almost too spammy.) But there has to be an API to trigger the rating request? Google is giving me no love on this one.
I would check out the Appirater project that Arash Payan has put together.
Pretty much handles the checking and displaying of the "rate my app" prompt, and brings the user right into the review portion of your app on the App Store.
It's a very clean, and elegant way to provide that minimum barrier so that your users are more likely to submit reviews of your app.
Hope this helps...
I have written about a way to open right into the review panel of the App Store.
http://www.memention.com/blog/2009/09/03/Open-Reviews.html
The actual code part if called through a button press could look like below
- (IBAction)gotoReviews:(id)sender
{
NSString *str = #"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:#"%#/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:#"%#type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
str = [NSString stringWithFormat:#"%#289382458", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
I wrote a library to do this - similar to Appirater but a bit more configurable and with Mac App Store support:
https://github.com/nicklockwood/iRate
I have discovered the most subtle value of S.O. (already obvious to all elementary school teachers) --- often by simply forming your question, your neurons rearrange and you are more successful at answering it yourself! (Either that or Google optimized my search after spying on my keystrokes and indexing my question on S.O.)
Answer found after more productive googling:
http://www.mobileorchard.com/fighting-back-against-the-app-stores-negative-rating-bias/
this may not be what youre looking for EXACTLY but what i would do is just prompt them in the app somehow and somewhere not too annoying with a button or alert view and have that button link them to app url in safari which opens the appstore to your app. you can use the url http://www.itunes/apps/ (your app) as i believe is the synthax. i cant remember the exact code but i can get it for you if need it.
We AskingPoint have another way to do it (Im a founder) that provides BOTH App Analytics and the rating widget. You can adjust server side settings based on your analytics to prompt only your best users. Change settings on the fly. And it's translated into over 30 languages.
I wanted to do this when I roll the app out for the first time... looks like I'll have to wait and put it out as an update to ensure that it will work... let me know if I am wrong and there is some way I can test this before submitting to apple for distribution.