Direct link for application updated version in AppStore - ios

Within my application there is alink to to appstore for downloading the new version of my application.
When user press this link, the iPhone open some screes before getting the AppStore screen.
Those screen, seem to be the browser's screens, but i'm not sure.
How can i create a direct link to my application in AppStore?
Thanks,
Eyal.

itms-apps://itunes.com/apps/APPNAME
Example:
NSURL *url = [NSURL URLWithString:#"itms-apps://itunes.com/apps/trenes"];
[[UIApplication sharedApplication] openURL:url];

Related

UIApplication openURL vs NSURLConnection initWithRequest for launching iTunes

I want to launch iTunes via my app. Currently there's a code that's doing that using [NSURLConnection alloc] initWithRequest. I'm thinking about changing it to [UIApplication sharedApplication] openURL.
What is the difference and what is the correct way?
Q: How do I launch the App Store from my iOS app? Also, how do I link to my application on the store?
A: The -[UIApplication openURL:] method handles links to applications and media by launching the appropriate store application for the passed NSURL object. Follow the steps below to obtain a link to an application, music, movie, or TV show sold on iTunes, and link to it from your iOS application:
Launch iTunes on your computer.
Search for the item you want to link to.
Right-click or control-click on the item's name in iTunes, then choose "Copy iTunes Store URL" from the pop-up menu.
In your application, create an NSURL object with the copied iTunes URL, then pass this object to UIApplication' s openURL: method to open your item in the App Store.
Listing 1 Launching the App Store from an iOS application
NSString *iTunesLink = #"https://itunes.apple.com/us/app/apple-store/id375380948?mt=8";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
see https://developer.apple.com/library/ios/qa/qa1629/_index.html
[UIApplication sharedApplication] openURL used when you need go to another app. In your case its AppStore
iOS Developer Library
Discussion:
The URL can locate a resource in the same or other app. If the resource is another app, invoking this method may cause the calling app to quit so the other one can be launched.
1.[NSURLConnection alloc] initWithRequest: is a way of network request.
you use it if you want to get some data from network
2.[UIApplication sharedApplication] openURL: can open an app according to the param.
I guess you may want to use [UIApplication sharedApplication] openURL:

How to open general settings (not in the app settings) from the app in iOS 8?

I know about this
if (&UIApplicationOpenSettingsURLString != NULL) {
NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[[UIApplication sharedApplication] openURL:appSettings];
}
But I wanna know if its possible to go to the general settings. I need users to enable the keyboard but landing in the app settings confused many users. Any suggestions to open the general settings and even if possible the keyboards section?
You cannot open system apps in iOS. You can show them the path to the message though.
'Settings->General->Keyboard' etc in a modal whenever you wish to display this information to the user.
Starting from iOS 10 the one can use "App-Prefs:root" URL:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"App-Prefs:root"]];

iBooks app crashes when opened with IBAction in my app

All right, I am having a problem opening the iBooks app using an IBAction in my app. I have it set up so that when the user presses a button, it calls this action to open the iBooks app:
-(IBAction)openBooks:(id)sender
{
NSString *stringURL = "iBooks://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApllication sharedApplication] openURL:url];
}
This does the whole app switching this and looks great. I see the bookshelf where all of my books should be, but then the iBooks app crashes before my books load! The app I wrote doesn't crash, but iBooks fails!
I am running my app via XCode (the app isn't actually distributed to my iPad, per se), is that why iBooks crashes? When I touch the iBooks icon to open it (not via my app) it opens fine and works. But if I change the url in my IBAction like this:
NSString *stringURL = "maps://";
and run my app, my button works and Maps opens up!
Is this an iBook bug? Or is it my bug?
FWIW, I'm using iOS 6 and XCode 4.6.3
You HAVE to check if iOS can open a url before opening it. Either your url scheme is wrong (like in your case) or the user doesn't even have iBooks installed. Even if you have the correct url you can't open it unless the user has installed an app that corresponds to the url.
NSURL *url = ...
if ([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url];
}
else {
// can't open url
}
OK, so my bad. I found that I was using the wrong URL scheme. The iBooks:// I got from wiki.akosma does NOT work, but itms-books: DOES work.

Code for check particular app was installed or not

I'm developing an app for iOS 6 with Facebook Share option. I need to check out that this app can able to check wether Facebook app was installed in device or not.
I have already tried with Account Store. But it was not working. Is there any some other way for this issue. I need help with code. Thanks in advance
You can test for it using -[UIApplication canOpenURL:]. The facebook custom URL scheme is "fb:".
NSURL *url = [NSURL URLWithString:#"fb://profile"];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
// Facebook is installed
}

eReader SDK in IPad

I need to developed an application for iPad, which shall download eBook from a server and launch eReader application,
i Believe eReader is App provided by amazon for iOS, i.e. whatever user brought form Amazon can read through eReader, i have following question,
1 -- Can i developed an application which invokes eReader app if its there,
2 -- are there any sdk available to access eReader properties, i just wanted to know, how long this application has been used.
1) You can open other apps using URL schemes. To open the Kindle app:
NSString *stringURL = #" kindle:/home";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
2) No, you can't acess any information about other apps using the standard APIs (i.e., without jailbreaking the device).

Resources