Download Other APP in iOS App - ios

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:"]])

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.

How to link an application to App Store?

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]];

Open iOS app from browser

What I want to do is,
We have having one product info on Website.
That product is available on store.
what we have on website is that, Product info and one button for that product.
I want to take two actions on that button.
When User opens website on iPad or iPhone on Safari (browser) and click on GetProduct button, then following two actions must be taken place.
1. If user is already having product installed on device then directly open the app in device.
2. If user is not having the app on device then link user to the app on store, so he can download from there.
I already handled second condition,
but how to handle the first condition.
If I am already having the app then how to open it on action of button click in browser.
You can achieve what you're asking for by using a URL scheme. This will enable you to call the openUrl: method with your application's url scheme which will then launch your app.
Here's how you setup a custom url scheme:
Open your app's Info.plist and add a row with a key called URL Types.
Expand the URL Types item, and Item 0 under it and you'll see URL Identifier
Enter your app's bundle identifier (e.g. com.myCompany.myApp) as the URL Identifier value.
Add another row to Item 0 and enter URL Schemes.
Expand the URL Schemes and under Item 0 type in the name for your custom scheme (e.g. myScheme).
You should now be able to open your app from Safari by typing myScheme:// in the address bar.
Alternatively, from your app, you can launch the other app like this:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"myScheme://"]];
Note that you can also send parameters to the app you're launching with the url scheme (more on that here).
With iOS9 Apple introduced a way to open installed app from Links. Here is the official link for this : Apple universal links

FBSessionLoginBehaviorWithNoFallbackToWebView opens safari if no app is installed

I want to log the user into my app with Facebook using (in this order) these methods:
The account stored in settings (via the Accounts Framework)
Switching to the Facebook App
Displaying my own UIWebView inside the app (and sending the requests
manually)
If one method doesn't work, I want to fallback to the next.
The problem I'm having is that
[self.fbsession openWithBehavior:FBSessionLoginBehaviorForcingWebView
completionHandler:
opens Safari or shows a popup that I can't customise.
I absolutely need to follow this order because I use a webview for other social networks (ie Twitter, LinkedIn and GooglePlus).
Is there any way to manually open the Facebook App for the Oauth flow ?
To manually check if the Facebook app is installed you can use:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"fb://requests"]]

How to open app which is available in simulator or device but not in app store through json link in iOS?

On my application I have to go from one application to another through json data.
If the app is available on app store then user wont get any issue but if app is not available on app store and if we are trying to call the json then it dosen't open the json url which I am getting through previous app.
Is there any way to open that app which is NOT available on app store but available through build or anything?
You can open any app using a custom URL scheme. Ask the app makers to add one and adjust the JSON and launcher accordingly.
Yes, you can open another application from your Application. but you need know the URlscheme for that Application.,
For Example i want to open an URl with some links, Then i will Use the following to open that URL From my application.,
NSURL *myURL = [NSURL URLWithString:#"http://www.google.co.in/"];
[[UIApplication sharedApplication] openURL:myURL];
if you want to know more about the URLScheme Refer the Following Link.,
It may help you
https://developer.apple.com/library/IOs/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW18

Resources