Open itune link in app store? - iphone

My application is in 3 languages, i want to open app store on button click and link is my another application. But when i am sending link to app store , its always opening US market with English description. when i am using browser its going correct. Where i am going wrong.
-(IBAction)Button_us_itune:(id)sender{
NSString *ituneLink =#"https://itunes.apple.com/us/app/My_application/AppID?mt=8&ign-mpt=uo%3D4";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ituneLink]];
}
-(IBAction)Button_fr_itune:(id)sender{
NSString *ituneLink =#"https://itunes.apple.com/fr/app/My_application/AppID?mt=8&ign-mpt=uo%3D4";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ituneLink]];
}
-(IBAction)Button_du_itune:(id)sender{
NSString *ituneLink =#"https://itunes.apple.com/de/app/My_application/AppID?mt=8&ign-mpt=uo%3D4";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ituneLink]];
}

It is might be because you are using/Logged in US store.

Actually it's pretty easy. You have two mistakes:
You are using country code in the links. i.e. you are mention exactly what store you want to open. This is bad because on some cases the user would open different store than the one you need. If you ask for US and user registered for another one you would lose him.
You probably can't tell which store the user is register to. So even if you create the the right link you can never tell which function to call (there is no API to know where the user is registered according to my knowledge - you can just know where he is or his language settings).
So, You could just remove the country code. i.e:
NSString *ituneLink =#"https://itunes.apple.com/app/My_application/AppID?mt=8&ign-mpt=uo%3D4"
But even then you would probably have problems with the link itself on some cases and in some OS versions.
I suggest you use a simple library called iLink that would figure out everything (at run time) and create the link you need that would work always. It also have a great feature that would prompt the user for an update if there is one on the store.

You are giving denmark app link. And I think you are logged in with other country.

Related

How to list All iPhone Apps By a SIngle developer in iPhone App?

In My Application I want show all my iPhone apps from itunes store in a tableview. If user clicks any one of cell it leads to take to appstore of that application.I know just statically by giving link of each application. As per my need i need to get new apps also after this installation.
You can use the search web service provided by Apple: http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html#searching
I couldn't find a way to search by artist ID for software, but you can still perform a generic query using the developer name.
For example, this would return apps by Gameloft:
http://itunes.apple.com/search?term=Gameloft&media=software&lang=en_US&country=us
Note that it's a query by name,so you can have false positives (apps where the name Gameloft appears but are not real Gameloft apps). You have to check the artistId property for each returned app (in this case, Gameloft's artistId is 282764297).
If you want to open the App Store to a specific app, use the trackId you got from the previous web service and then
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:
[NSString stringWithFormat:
#"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",
trackId]]];
Instead of doing your own table view, you can also use StoreKit to display the apps, and let the user purchase other apps right there.
Just replace 383916386 with the correct id for your developer account.
SKStoreProductViewController *viewCtrl = [[SKStoreProductViewController alloc] init];
[viewCtrl loadProductWithParameters:#{SKStoreProductParameterITunesItemIdentifier: #"383916386"} completionBlock:nil];
[self presentViewController:viewCtrl animated:YES completion:nil];

iPhone dev - How can I call a phone number from within an app? Also, how can I hang-up from within the app?

Those are the two basic questions. First of all, I need to know if it's even possible to programmatically hang-up the phone from within my app (when the user presses a button, for instance). Also, is it possible to make a call from within my app, without having to leave my app? As in, the user can talk on the phone, but still see my app front and center the whole time?
Thanks
No to both questions*: it's not possible, unless you go to the dark side (jailbreak).
To know what kind of options are available to developers in regard to the phone functionality, take a look at Core Telephony's documentation.
You can pass a phone call by passing a url of the type tel://%# to [[UIApplication sharedApplication] openURL:url] but you can't "stay" in the App itself (phone.app will take care of the phone call).
When you programmatically make a phone call, your app jumps into the phone app.
You can make a phone call like this:
NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat:#"tel://%#", kSavedNumber]] autorelease];
[[UIApplication sharedApplication] openURL:url]
Once you do this, the user will not be in your app, and they will be hanging up using the standard phone interface.

Help me to run a iPhone application

I am going to develop a iPhone application.
In that i need to run another iPhone app when the user clicks on the button.
Is it possible to run a iPhone app from another iPhone app?
If possible, Please let me know your inputs on this.
Thanks for any help.
[copy and paste of a previous answer I gave here for the click-averse]
You can use the url scheme built into iOS. For example, you could call Safari with a url because it is registered as the application which handles the http URL scheme
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.google.com/"]]
The openURL: method is an instance method of the singleton UIApplication instance, on which you can call any application installed which registers in its plist an ability to handle some sort of input data.
Here's a list of common url schemes in iOS.
A little known way to detect the existence of another application on a device is to use canOpenURL: on the same singleton instance:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"cydia://"]])
{
NSLog(#"cydia installed");
}
else
{
NSLog(#"cydia not installed");
}
Only if that other app is already installed and run and has been designed to register a custom URL handler to itself with the OS.
The your app can run it by using that custom URL scheme.
If the app has a custom URL Schema and you know what it is, then it is possible to launch another app form yours.
When user pressed the button, your current app will close and run the new app..
Yea.. Its possible.. BUT you must know the "short link" of the other app.. I tried it before and even successfully transferred data from the lite version to the full version..
Its called url scheme..
Here's a link:
http://www.idev101.com/code/Objective-C/custom_url_schemes.html
Hope it can achieve what you want..

how to open app store with in our ipad or iphone application?

Hi i want to open app store with in our application with the specific publisher search or specific application types..on clicking of button..let's say More App's...
You can get the appropriate URL to your app here:
http://itunes.apple.com/linkmaker
If you enter the name of your company the linkmaker will provide an "artist link" that shows all of your apps.
If you use the itms-apps:// prefix the user is sent directly to the
App Store App with the specified app showing rather than the ugly
first-Safari-then-the-App-Store-App shuffle that you get without that
UTI. A la:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:
#"itms-apps://yourAppLinkHere"]];
To generate a link that is universal and not specific to an App Store Country do the following
Use
itms-apps://**ax.itunes**.apple.com/app/yourAppLinker
where yourAppLinker is the part of the link generated in (http://itunes.apple.com/linkmaker), as in Matthew Frederick's post, which contains your application name and id
it worked for me
cheers
For IOS7 and later for example:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms-apps://itunes.apple.com/app/id547101139"]];

Use of setApplicationBadgeString on iPhone SDK

I am developing a piece of code which where I would like to dynamically update the badge of the application, so show its status. Pretty regular.
I am using this following API
[[UIApplication sharedApplication] setApplicationBadgeString:#"x"];
My problem is that when I try to use this API multiple times within an application session, the badge which is displayed on the Springboard does not get updated.
My use is
//Check if user is logged in then
[[UIApplication sharedApplication] setApplicationBadgeString:#"On"];
//wait for network event
[[UIApplication sharedApplication] setApplicationBadgeString:#"Off"];
Any help will be much appreciated.
Nitin
What you're describing works perfectly on my end.
This is an undocumented API, so I can't confirm, but perhaps it needs to be executed on the main thread, not a background one.
Also, be advised that because this is a private API, its use is grounds for rejection from the AppStore.