Swift : get all installed application and open specific one - ios

Is there any way to get all the list of installed application and check a specific bundle/app can be open which is already installed in swift ?

You can only open an app if you know its URL Scheme just like facebook provides for example. fb://
There is no way to get the list of applications. Can't say anything about jail broken devices.

Related

iOS / Windows Store App: can I know whether my other app installed on this device/user account?

I have several apps and I want to know from app A whether app B or C are installed. In Android I can check does package exist, but is there something like this in iOS and windows store app? I'm using Xamarin for iOS.
For iOS you can get your apps to confirm unique URL schemes and check whether they can be opened.
References:
URL schemes - https://www.appcoda.com/working-url-schemes-ios/
Can open url - https://developer.xamarin.com/api/member/UIKit.UIApplication.CanOpenUrl/p/Foundation.NSUrl/
You can use system Keychain to achieve this.
Values in system Keychain can be shared between collection of apps and you can set values like isAppBExists and isAppCExists to true/false in this apps. And then check this values in app A
Link to documentation
For UWP app, you can use PackageManager.FindPackagesForUser Method to find all packages installed for the specified user.
See the following similar topic:
how to get list of all installed apps and run them in UWP WinRT 8.1
Get List of installed windows apps

How to get apps names list Swift 4

I'm new to IOS developing and I've been looking for a way to get list of apps names installed on a device but from what I have found is that Apple removed this from Swift 4. Is it true and if so is there an alternative way to get them?
There is no way to get list of installed apps on IOS device , but if you have the url Scheme you can check with UIApplication.shared.canOpenURL method whether an app is installed or not
This was never a feature on iOS because it would seriously hurt a user's privacy if it was. The solution using canOpenUrl works is you know the url scheme for a certain app but in theory any app can subscribe to any scheme so there are no guarantees there either.

How do I find an apps/websites Deep Link?

I have a cordova app which uses the AppAvailability Plugin (https://www.npmjs.com/package/cordova-plugin-appavailability) and I have to find out if a specific app is installed. Its easy on Android, since I just know the packagename, but on IOS I have to know the URI Scheme or the DeepLink (eg. myapp://).
But I just seems to not be able to find out how to get it. Example is the asos.com.au website and their app. The Package name is 'com.asos.app', so that part is solved.
But if you go on the website (or in my usecase, if you are forwarding to their website) it opens the app if is available. And if it is available I want to have my app know that it wont redirect to the website (this is actually pretty important).
So, on IOS I have to know this URI Scheme.
Any Ideas?
This sounds like asos.com has implemented deep linking, and indeed http://www.asos.com/apple-app-site-association is present and looks good. Find more documentation here: https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

Deep Linking in iOS - Navigate to Apple Store if app not installed

I need to implement Deep Linking concept without using any third party libraries (Branch and etc..). The link (starts with http/https) will be shared from app through Message, Email or any Social media apps. By tapping on shared link I want to open corresponding app if its already installed on device else it should navigate to the Apple Store to download the app.
I have knowledge on URL schemas but it works only when the app is already installed on device and the schema URL format also be different (like fb:// for Facebook app).
I have also done some R&D on Universal Links but I don't know whether it supports for dynamic links as for me the link will be combination of base URL(static) and referrer key(dynamic). I also need to track the referrer information once the corresponding app is opened like who referred this app (referrer details).
e.g: https://domain.com/ReferrerID
Can you please help me on it. Thanks in advance.
To make it clear on Universal Links in iOS will not take you to Apple Store if app is not installed on device. When you click on a link then Universal Links helps you to open the app if the app is already installed on device else the same link will be going to browse in Safari. When the url browse in Safari then we have to run JavaScript to navigate/redirect to Apple Store.
Yes you can support universal links to your application from iOS 9 or above. You can generate dynamic links and have deferred deep linking also.
Follow this steps its simple Click Here
For the file mentioned in the link you need to add that file in the root of your website which consists of the path valid for deeplinking. And that file should not have any extension.
Then validate your domain at Here.
After that you can add all the domains thing in your associated domain under the project capabilites.

How do Apple detect if an iphone app is installed when clicking on a pure html link?

I am trying to detect if my ipad app is installed on a device when visiting my website, in order to suggest different action to the visitor.
Thanks to this post :
https://stackoverflow.com/a/8310348/1128754
I found that the "store" application on iphone seems to have achieve to detect if the app is installed on the device. When you click on store links, it launch the app instead of going to the mobile web version.
For example, if you go to :
http://store.apple.com/xc/anythinghere
with an iphone on which apple store app is installed ( http://itunes.apple.com/app/id375380948 )
it automatically start the store app, instead of the web page.
I tried to follow the stack call with mitmproxy but safari doesn't seems to ask query before launching the app.
So, I guess they did custom url scheme recognition, with http:// links.
Do you think it is possible?
This is done with URL protocol handlers:
http://www.iphonedevfaq.com/index.php?title=URL_schemes#URL_Protocol_Handlers
You cannot detect if an app is installed from HTML, but you can launch an app. For example, the popular game "Doodle Jump" can be launched by going to doodlejump://, but if you don't have it installed, the link won't work. As mentioned, this is done with a custom URL scheme and needs to be coded into your app.

Resources