Initiate phone calls without confirmation dialog like 1-2-Contact - ios

Some time ago, I wrote a small app, which needs to create outbound phone calls on iOS. I used an URL to prepare the call like described here.
Since I never found an iOS method to perform the call - without a 'Would you like to call...' confirmation dialog - I finally dropped the project.
Recently I found 1-2-Contact, which does just this: If I press the phone icon, the phone call gets established without a confirmation dialog.
Does 1-2-Contact use a private frameworks? Or does a 'initiate phone call' method exist?

Try the following:
NSString *phoneNumber = #"9123123"; //your number
NSString *telString = [NSString stringWithFormat:#"tel:%#"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telString]];
Works for me.
Edit 1:
NSString *dtmfAfterPickup=#"0";
NSString *telString = [NSString stringWithFormat:#"tel:%#,%#", phoneNumber, dtmfAfterPickup];

Related

Alternative way of sending e-mail from app on iOS 10 when Mail app is deleted?

Now that Apple's "Mail" app can be deleted in iOS 10 and using [MFMailComposeViewController canSendMail] is always return NO when Mail app is deleted.
Is there any alternative way for sending Mail from inside the app?
You can use the MailCore Framework. This is an alternative to MFMailComposeViewController. Using this framework you can send an email programmatically. You have to construct each and every field i.e, To,CC,BCC,Subject,body etc. by yourself using this. One important thing to remember it has no UI.
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];

iOS- call a phone number without sharing their number

My app allows users to call another with click of a button. But user's don't want to share their number. That is when user tries to call another one , app will hide their mobile number and display only their name saved in DB or any random digits. Is it possible in iOS?
I know how to do mobile calling in iOS.
NSString *phNo = #"+912436580";
NSURL *phoneUrl = [NSURL URLWithString:
[NSString stringWithFormat:#"telprompt:%#",phNo]];
if ([[UIApplication sharedApplication] canOpenURL:phoneUrl]) {
[[UIApplication sharedApplication] openURL:phoneUrl];
} else
{
UIAlertView *calert = [[UIAlertView alloc]
initWithTitle:#"Alert"
message:#"Call facility is not available!!!"
delegate:nil
cancelButtonTitle:#"ok"
otherButtonTitles:nil, nil];
[calert show];
}
Is it possible to hide the calling number? Please help me.
It is impossible:
1) You must be able to know what number you are calling, it is very important so that you avoid fees for surtaxed numbers, and apple won't let you do otherwise.
2) Even if you manage to hide the phone number, it would still appear on the bill from the user mobile operator.
Only workaround would be to call through a secure connexion to a SIP server (Without using voice call feature of the phone), but then it wouldn't transit through the phone app, and the usual voice plan of the user.
I think it is not possible.
The Call application only allow you to pass numbers to call and you do not have control on what to show as Title (Name OR Number) while calling using Call app of device.
But if you are calling to a Number which is in your device Contact then it will show Name of the person matching Number.
But it is not possible to show your desired Name while calling from your application.

Open appstore via itms-apps

i'm trying to open an app in appstore from an UIAlertView When the otherButtonTitle. The problem is nothing is happening.
I've checked when the otherButton is pressed if this method is called and it is. The problem lies in the openURL i guess. the appId contain an name of an app without any whiteSpace like "youtube". How come the link is not opening? i've tried looking in other threads and this is the code that should open an app in appstore
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex: (NSInteger)buttonIndex
{
if (buttonIndex == 1)
{
NSString *appId = [[otherArray objectAtIndex:currentRow] objectForKey:#"link"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat: #"itms-apps://itunes.apple.com/app/%#?mt=8", appId]]];
}
}
You need to break it down into smaller steps and debug the steps.
First, is the didDismiss method being called.
Next, is the code inside the if statement being executed.
The easiest way to figure this out is to set a breakpoint on the code that assigns appID and then make sure your code breaks there.
After that line executes, make sure appId contains the string you expect it to.
Net, you should rewrite the last line into steps that first create the URL, THEN call openURL. Step through the code that creates the URL to make sure it is being created correctly.
You might want to copy the URL string and paste it into a browser to see if it works from there.

Rate this app funtionlity

i am trying to provide the rate this app functionality into my application hence i added the below code
- (void)gotoReviews
//------------------
{
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];
str = [NSString stringWithFormat:#"%#APPid", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
str = [NSString stringWithFormat:#"%#APPid", str]; here i have to mention my app id.i see the appid into the provisioning portal as following 546F5QMTE4.com.XXXX.XXXX into the APp id section.
Is that the "546F5QMTE4" string need to placed? am i right is that correct id?
please let me know
You can do this in many ways:
Direct approach:
#define APP_ID XXXXX //id from iTunesConnect
NSString *reviewURL = [NSString stringWithFormat:#"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",APP_ID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:reviewURL]];
Try with Appirator in app delegate:
[Appirater setAppId:#"552035781"];
[Appirater setDaysUntilPrompt:1];
[Appirater setUsesUntilPrompt:10];
[Appirater setSignificantEventsUntilPrompt:-1];
[Appirater setTimeBeforeReminding:2];
[Appirater setDebug:YES];
You can get source: Here.
Add Appirater.h and Appirater.m to your project.
For more information about integration: Here
:)
No, it is not that number. You have to go to the iTunesConnect -> Manage Your Apps, choose your app, then look under "App Information" for Apple ID (digits only).
Of course be sure that you have actually a record for your app. If not, just make it (Add New App button).
iRate is best https://github.com/nicklockwood/iRate
The one that I use and works wonders on iOS 5+ (also available for Mac OS X, but this answer is focused on the iOS portion) and up on all devices (iPad, iPhone, iPod Touch) is iRate.
It uses a uialertview and storekit to ask the user for a rating (or to remind them later). Everything is customizable, from the name of the Cancel Button Title to the Interval at which it reminds the user.
By default, iRate automatically opens when certain requirements are met (ex. app launched X number of times, user passed X number of levels), but you can also use a variety of methods and your own logic (with the help of iRate methods) to manually display an iRate popup.
Setup
To install,
just drag the header (.H) file the implementation (.M) file, and the iRate Bundle (for localization) into your project.
Import the header in your AppDelegate: #import "iRate.h"
Add the StoreKit Framework to your project - More on StoreKit from Apple Documentation
Add the following method to your app delegate: + (void)initialize
The properties can be set in the initialize method, however none of them are required (iRate can automatically find all of this information).
No, it isn't. It's rather a numeric ID with a few digits, something like this:
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=389801252&pageNumber=0&sortOrdering=1&type=Purple+Software
This will only be live when your application has been approved by Apple and it's already on the AppStore (in case of an intentionally delayed launch).
Furthermore, the way you're composing that poor URL string is simply horrible. Don't abuse format strings! You have a constant string here, so you don't even need any call to + [NSString stringWithFormat:]. Even if you wanted to alter the app ID, you could do that using one single formatting statement:
NSString *str = [NSString stringWithFormat:#"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%#&pageNumber=0&sortOrdering=1&type=Purple+Software", appID];

Alternative to MFMailComposeViewController?

is there an alternative to MFMailComposeViewController that has more-or-less the same functionality, but that will let me handle the sending of the email myself, outside of Apples email-sending system?
What I want to do is to provide a nice email dialog, and then send it through a CRM system instead of directly from the iPad.
Cheers
Nik
YES, You can use the MailCore Framework. You can handle the sending of email by yourself. Before sending the mail you have to set its fields such as To,CC,BCC,Subject,body etc and then send by the following code..
CTCoreMessage *msg = [[CTCoreMessage alloc] init];
[CTSMTPConnection sendMessage:msg server:[server stringValue] username:[username stringValue]
password:[password stringValue] port:[port intValue] useTLS:tls useAuth:auth];
[msg release];
It works for me fine. Hope it will help you..
You will need to create your own email view and handler. You can use something like JSTokenField : https://github.com/jasarien/JSTokenField to get the functionality on the mail "To:" field.

Resources