Hi All,
Thanks for the suggestion well i am writing in detail about it.
I have a requirement to do in my project like this,
- When the app launch for the first time it should display the device native dialer and then check for callDidConnected in background.
- once the callDidConnected is true app should launch itself.
Here I tried a logic to do so. please have a look to the pseudo code.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
//i am dialing to a IVR from the native dialer
if (/* A check to validate wether to call or not */)
{
NSLog(@"Dialing");
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:"]];
// A loop check wether the call get connected
while (!callDidConnected){
callDidConnected = // doing a check with server
}
// if call get connected then launching my application
if (callDidConnected){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"MyApp:"]];
}
}
else
{
// normal app
}
}
- (void) applicationWillTerminate:(UIApplication *)application
{
}
- I registered the app with URL MyApp.
Well I tested this code on simulator(on SDK 3.0/3.2) with opening another app(tried http instead of tel protocol). The check executes in background while other native app(safari) run in foreground.
So this look a little odd behavior what apple guys says.
So can any one help me to find whether i can use this code in my work. and will it be acceptable by Apple store.
Thanks in advance.