Call to a phone number through iPhone App - ios4

Hi iPhone developers, I want to add a feature in my iPhone app, they are:
call to a phone number in my app
after call end, relaunch the previous app.
I know its not possible in iphone OS 3.2..
Is it possible in iOS 4?
I need your help...

You can't call a number directly from your app. You can use this snippet to launch the phone app:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:12125551212"]];
... and after the call is done it will return you to your app.

Related

phone call in Windows 10 UWP

Currently, I found Windows.ApplicationModel.Calls API. unable to make a call or launch different options available to make a call from my app.
And also I try this Code but still can't implement the Phone call function, any solutions for UWP? Thank You.
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1,0))
{
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
}
I've come with a solution that is working on emulator, I cannot test it on actual device, cause I don't own one.
PhoneCallStore PhoneCallStore = await PhoneCallManager.RequestStoreAsync();
Guid LineGuid = await PhoneCallStore.GetDefaultLineAsync();
PhoneLine = await PhoneLine.FromIdAsync(LineGuid);
PhoneLine.Dial(phoneNumber, nameToBeDisplayed);
You have to add Windows Mobile Extentions for UWP to references of your project as well as declare PhoneCall capability in app manifest.
The line,
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
only shows the Call UI. It doesn't make a phone call.
You should use Windows.ApplicationModel.Calls.PhoneLine.Dial to make a phone call. See this for reference https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phoneline.aspx
See this example https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/PhoneCall/cs/Helpers/CallingInfo.cs#L85

UIWebView not loading data sometime in iOS 9

UIWebView not loading (mobile web page) sometime in iOS 9. I already used ATS bypass using NSAllowsArbitraryLoads.The issues not happening always and works well in iOS 7 and 8.
The delegate method webViewDidStartLoad invoked but webViewDidFinishLoad and didFailLoadWithError is not getting called at all.
Found the solution.All you need to do is remove UIWebView in iOS 9 and use WKWebView.My webpage had some third party calls to twitter,instagram etc which is https.Also I was getting Auth challenge in my webpage..! (Even I disabled the ATS).I found this by using WKWebView,which has the delegate to handle auth challenge.
Set the below delegate to get the auth challenge and handle it.
- (void)webView:(WKWebView *)webView
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
{
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
CFDataRef exceptions = SecTrustCopyExceptions(serverTrust);
SecTrustSetExceptions(serverTrust, exceptions);
CFRelease(exceptions);
completionHandler(NSURLSessionAuthChallengeUseCredential,
[NSURLCredential credentialForTrust:serverTrust]);
}

How to collapse system tray in windows 10 Phone UWP

I'm developing windows 10 UWP app. I need to collapse system tray only for Windows 10 Mobile app.
Finally I got answer
var statusbar = "Windows.UI.ViewManagement.StatusBar";
if (ApiInformation.IsTypePresent(statusbar))
{
//await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
}
Note: Don't forget to add windows phone extention before using above code
Fore more Info:
https://msdn.microsoft.com/en-us/library/windows/apps/Dn609832.aspx
I find the way that can help you! u should use this code in the public MainPage() class
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
this code hides the status bar and make ur app full screen in phone

Launch Settings from app?

Anyone know if it's now feasible to launch the 'Settings' app from your app? Google Maps does it when you don't have Location Services enabled and you try to locate yourself.
I've seen lots of folks post about it and most answers point to adding a bug in Radar.
In the wild, I know of two apps that show this dialog with ""Turn on Location Services to Allow [app] to Determine Your Location" along side Cancel and Settings buttons where the 'Settings' button will take you to the General Settings.
1) Facebook app version 3.3.2 that runs on iOS 3.1.3 shows this alert on start. I looked at the three20 source code in git-hub but that project is not really a full source of the app but more of a library with the app's components.
2) GroupMe also shows the same alert when adding current location to a new message.
You mean the settings of the app like you see in settings?
First create a settings.bundle in xcode>newfile>settings.bundle.
This will create some prop lists that you can edit from out of the Settings.app or your app self. For the exact code Google can help you a lot further that I can. If you have any specific questions; don't hesitate to ask.
In iOS 5.0 you can open settings using the "prefs://" URL scheme. But in iOS 5.1 it doesn't work. But there is a trick I used for login twitter account using settings inside my app. the code is
TWTweetComposeViewController *tweetViewController = [[TWTweetComposeViewController alloc] init];
// Create the completion handler block.
[tweetViewController setCompletionHandler:^(TWTweetComposeViewControllerResult result)
{
[self dismissModalViewControllerAnimated:YES];
}];
// Present the tweet composition view controller modally.
[self presentModalViewController:tweetViewController animated:YES];
tweetViewController.view.hidden = YES;
for (UIView *view in tweetViewController.view.subviews){
[view removeFromSuperview];
}
Using this code you can switch to settings from your app directly if you are not already logged in twitter account.

How to resume iPhone app after a Phone Call

I am creating an iPhone app in which I am providing a call feature with the help of which a user can call place a call on a specified number. I am able achieve the above feature via open URL.
Now after completion of the call I want to resume the execution of app automatically. Although a user can make a fast app switch in iOS 4.0. but I want this to be done automatically.
I have seen the same behavior in "TomTom" app but I am not sure how this app has achieved it.
Thanks
Sandy
Apple does not allow you to resume an app after a phone call. What you can however try doing is using a local notification.
After calling the 'call' url handler you will need to start a background task and monitor for a call state change:
CTCallCenter *c=[[CTCallCenter alloc] init];
c.callEventHandler=^(CTCall* call){
if(call.callState == CTCallStateDisconnected) {
// do stuff here
}
}
When you get a call state change, create a local notification to alert the user to resume the app. If the user taps on "view" your application will then come to the foreground. Obviously if the call is longer than 10 minutes this won't work as Apple only allows 10 minutes to background tasks.

Resources