How to link an application to App Store? - ios

Don't get this confused with the itunes linking. I know how to send a user to iTunes Store app with purple logo and that is not I want. I want to send the user to App Store app with blue logo.
itms://itunes.apple.com/us/app/myappname/myappid
Already checked this post, didn't answer my question: How to link to apps on the app store

The follow link sends someone to the App Store on iOS and allows them to review my app. Change the parameters and it will go to the App Store for your app:
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Bouncing+Ball+Games&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=926193671
Sample code to open within an app:
NSString *iTunesLink = #"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Bouncing+Ball+Games&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&id=926193671";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

Related

How to open ios app using url?

I want to open my ios app using URL schemes. I am able to open app using this.
But I want if app is not installed then app store should be opened where user can download app.
Is this possible? How can I do that?
EDIT
Explaining question step wise:
I have a mail in my inbox with a url.
I click on URL then
i. If app is installed in phone, app will launch.
ii. Otherwise app store will be opened to download app.
Thank
I handled it via my server side code:
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("com.myapp://");
setTimeout(function() {
if (!document.webkitHidden) {
location.replace("https://itunes.apple.com/app/xxxxxxxx");
}
}, 25);}
else if ((navigator.userAgent.match(/android/i)) || (navigator.userAgent.match(/Android/i))) {
location.replace("https://play.google.com/store/apps/details?id=packagename&hl=en");}
else {
location.replace("http://www.example.com");}
I put this in my www.mysite.com/download page & share this url via campaigns.
What you're describing is called Deferred Deep Linking (Deep Linking refers to using a link to open your app, even directly to a specific piece of content, and Deferred means that it works even if the app isn't installed first).
Unfortunately there's no native way to accomplish this yet on either iOS or Android. URL schemes don't work, because they always fail if the app isn't installed. Apple's new Universal Links in iOS 9 get closer, but you'd still have to handle redirecting the user from your website to the App Store
A free service like Branch.io (full disclosure: they're so awesome I work with them) can handle all of this for you though. Here's the docs page covering exactly how to create email links like you described: https://dev.branch.io/features/email-campaigns/overview/
If your App is not installed in device then, you can open app store using below lines of code:
NSString *iTunesUrlofApp = #"itms://itunes.apple.com/us/app/apple-store/...";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesUrlofApp]];
Try below code:
if([[UIApplication sharedApplication] canOpenURL:url]){
// Means your app is installed, and it can be open
[[UIApplication sharedApplication] openURL:url];
}
else{
//Your app is not installed so, Open app store with your apps iTunes Url
NSString *iTunesUrlofApp = #"itms://itunes.apple.com/us/app/apple-store/...";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesUrlofApp]];
}
After iOS 5 you can also use https:// to avoid redirections.
Edit:
Check the link to open app from url if installed: Universal links to open app from Url.

Download Other APP in iOS App

In my application there is a button to download other app from app store.
When user click on this button , my app open app store for particular app.
If user click on download and download application , how can my app get to know that user has successfully downloaded a particular application.
You can poll for the successful installation, but you can't be notified of it.
Three steps:
all of your applications must register custom URL handlers as in myapp1:, myapp2:, myapp3, ...
In your plist, add an entry for LSApplicationQueriesSchemes and list all of your other apps as in myapp2:, myapp3:, etc.
poll for the availability of the URL using:
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"myapp2:"]])

iPhone App: Launch My App on My Website and Tips

I hope this is not asked before, I've searched and not sure those are the answers that I want (iPhone apps: Can I open an app from a link in a website? and Apple URL Schemes). Plus I haven't developed my website yet either, so I'll probably need some tips for that too.
My goal is to develop a website AND an iphone app that can eventually connect together. For example, something like Yelp or YouTube: you can go to their website on phone and they will tell you that either you can download their app or you can launch their app from there. Also IF they launch the app, the app will be displaying whatever they were looking at (maybe the same page, etc.)
So my questions are:
1) Can you give me suggestions regarding the development flow? (App first or website first, framework, etc.)
2) How do you actually connect them and make your app to go to the correct view?
Thanks a ton!
1) Can you give me suggestions regarding the development flow? (App
first or website first, framework, etc.)
I recommend you start with what you do best, so you're more productive. Unfortunately I have no site hint to give you, sorry.
2) How do you actually connect them and make your app to go to the
correct view?
You can use this for open any website:
NSURL * URLMyWebSite = [NSURL URLWithString:#"http://www.google.com"];
[[UIApplication sharedApplication] openURL:URLMyWebSite];
For open your app, you need enable URL Scheme, only add URL Type into plist:
After this, you can open your app:
Open My First App
And you can send parameter:
Open My First App
Use HelperLibrary for parse query string into NSDictionary.
Other app can open your app:
NSURL * URLMyFirstApp = [NSURL URLWithString:#"myfirstApp://login?username=rondinellimorais&password=1234"];
if([[UIApplication sharedApplication] canOpenURL:URLMyFirstApp]){
[[UIApplication sharedApplication] openURL:URLMyFirstApp];
}

How to send the user directly to the review page on The App Store?

Up to now (with iOS < 6.0), I used the following URL and code to send the user directly to the review page of my app (to rate it with 5 stars and post a friendly comment :)):
NSString *stringUrl = #"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=XXXXXXXX&pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8";
NSURL *url = [NSURL URLWithString:stringUrl];
[[UIApplication sharedApplication] openURL:url];
This code doesn't work anymore when I run my app on a device with iOS 6 (and the new appstore of iOS 6). The appstore opens but then I have got an alert saying "Cannot connect to Appstore".
Anybody knows how to send the user directly to the review page of the Appstore on iOS 6 ? (note that I know how to send the user on the description of my app by this not what I want !)
Thanks !
Use url like this
https://userpub.itunes.apple.com/WebObjects/MZUserPublishing.woa/wa/addUserReview?type=Purple+Software&id=561892747&mt=8&o=i
I found it on a link to "write a review" in Apple receipt email.
I guess apple almost fixed the issue, since it can go to the review page directly with the same address again. Users still need to tap the button of review on iOS6 after they are directed to the review page though.

In-App review feature in iPhone App

I have recently seen in some Apps that review and rating (with 5 stars) can be integrated into the app. Does anyone have an idea how this is done? e.g. with a http request?
More specific: Can I create a view in my App with a UITextField and a Button, so that when the user writes his review in the textfield and click send, the review should be posted to the "Customer Reviews" in the App Store? and the rating should also be done inside the App similarly.
Yes, I did this with my own app. I have a rating button that hits the following method on click:
- (IBAction) reviewPressed: (id) source {
NSString *str = #"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=341086403";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
You will need to replace the ID in the URL with your own App ID. For new apps, this presents you with a chick-and-egg problem - you don't have an ID until the App goes live.
You can get your application ID by going in the process of submitting an app but choose to upload the app binary later. You will then get the app ID and thus add it in your code.
I think its late but this is the best solution.
You can use below url to directly send user to write a review page on App Store. Just need to replace application id.
itms-apps://itunes.apple.com/gb/app/id1136613532?action=write-review&mt=8
Example :
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms-apps://itunes.apple.com/gb/app/id1136613532?action=write-review&mt=8"]];
Here My Application Id is 1136613532. You can replace it with yours.
Tested in iOS 10.3

Resources