How to get any App's Bundle ID or App ID in iOS - ios

Is there a way to know any App's bundle ID or App ID which is running in the foreground? I have seen this feature in this App called Backbone, which asks user to open any App, press a button on their hardware (Which is a game controller, connected to iPhone via lightning connector) and then a link/shortcut to that App gets added in their App. It seems like they are able to establish a link between their App and other Apps, based on what I know so far it is not possible without knowing the Custom URL scheme of the App.
Anyone knows if there is another way it can be done?
Thanks in advance!

URL Schemes are the only way to communicate between apps. So, no, it's not possible to launch any other apps.
But it is possible to launch any app that registers a URL Scheme, whether it's Apple's, yours, or another developer's.
For more info, check this question discussions.

Related

Implement deeplinking to bring user to install an iOS app and after install take them into the app

I want to implement deeplinking whereby a user that does not have my app will be brought to the store to install the app, and after install they are taken into a specific part in the app?
The second part is not clear to me - how will user be brought into a specific part of the app after installing and launching it? Does iOS retains the link info?
The simple answer to you question is yes you can do those things but no you cannot do them in the way you want. You would not be able to launch to the app store and then once the app is downloaded launch into a specific place in the app. This is mostly due to security.
So let me explain, there is a method that you can call UIApplication.sharedApplication()canOpenURL(url) which will return a Bool on wither or not you app can open a url. If it comes back as false then you can assume the app does not exist on the device and you can call UIApplication.sharedApplication().openURL(url) where your url = NSURL( https://appsto./Path/to/your/app) then "The User" will have to click the download button.
Then if they try the action again you can callUIApplication.sharedApplication().openURL(url)withurl = (yourapp://).This will launch your application.
Now for launching to a specific place in you app you will need to setup schemes for your app. There is a decent tutorial on doing that here http://www.brianjcoleman.com/tutorial-deep-linking-in-swift/ and also a short synopsis of what you can do found in another answer to deep linking here Confused with IOS Deep linking
So you can get most of the way there but with Sandboxing you will not be able to launch the store, download the app and launch the app all in one move.
Hope this helps, cheers.

Kiosk App in iOS can we provide any identifer to that app to use from URL scheme.

I wanted, to give some identifier to the app that we create like a kiosk mode in iOS.
i.e. We make add to home screen and it has an icon on home page which browse further.
Is there any way, where I can give some identifier Name to that link of app getting created so that we can get that app access from our Native and we can provide URL Scheme for the same.
Thanks.
iOS will not give access of all the url schemas. You can refer this document where the url schemas for selected application is given :
http://wiki.akosma.com/IPhone_URL_Schemes#Phone
It may be that the only way you can achieve what you want to do is to build an app around an iOS UIWebView. You can then include the camera functionality directly in the app, although there can be issues as a UIWebview doesn't handle things like popups that Safari does.

How to get a list of your iphone apps

How can i get a list of all my iphone apps (even pointers for each app will be helpful)?
I'm developing an app which contain some screen that should have a list of all my installed apps (with their icon) and the option to select one to launch it in the future depends in other function of mine.
Thanks alot!
There's no way to accomplish this, because each app is sandboxed.
You would be able to determine if select apps are installed if they have custom URL schemes. For example, the Facebook app can be launched with the custom url scheme "fb://", but these aren't guaranteed to be unique, so a different app could use a scheme that's well known to belong to another app. Also not all apps have a custom URL scheme, and you would need some master list (that would need to be constantly updated to be accurate) to check for the presence of each. So you could maybe detect a select list of well-known apps with custom URL schemes, but never get a list of all of them.
If you just wanted to detect your own apps, you could have custom URL schemes that are almost certainly going to be unique set for each app, and check for those.
You could also jailbreak your device, but I'm assuming you want this functionality in an app that is distributed on the app store, so you wouldn't be able to add functionality that requires a jailbreak to work.
EDIT:
Here's an example showing detection of the Facebook app being installed:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"fb://"]])
{
// Handle the Facebook app being installed
}
Note however, this won't give you any information about the app. Any app developer could add the "fb://" custom url scheme to their app, which would make this falsely detect it.
If you want to find lists of custom url schemes for iOS apps, just search in Google.
another way to look at this is to present the user with all of your app in the appstore. If they have any apps installed on their device then in iOS 7 they will see a button called "Open" next to each of them.
For example you can have a UITableViewCell or a UIButton that says "Checkout Our Apps". In the code you would add this.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"itms://itunes.com/apps/sixaxisllc"]];
Replace SixAxis LLC with your iTunes developer name and when users click on it, it will launch AppStore app with only your apps are shown. (With Open or price amount next to each of them)
NOTE: test this on actual device and not in simulator
Because of the Sandboxed environment, all you can do is test if it you can open a custom URL.
Akosma Software maintains a list of popular Url on his wiki: IPhone URL Schemes.

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.

How to launch an app using NSURL and -openURL:?

There are a few apps which I find very helpful and want to recommend to my users inside my app. If one such app is installed, and the user taps the button, I want to launch that app. Otherwise open the app page in the App Store app.
UIApplication provides a -canOpenURL: method which I think can be used to check if an app exists on the device. With -openURL: an app can be launched. But how do I construct an NSURL to launch an app?
The apps I want to refer to don't have any special registered URL scheme, at least not that I know of. All I know is their name and app ID.
Is that possible or must the developers of these apps update their apps to support custom URL opening schemes?
It is only possible to open the app by url in case it has known registered URL scheme (it may me your application or one of the existing iOS schemes)
Here is a list of public URL schemes. This however is just a fraction of what is out there in the market. It may however be helpful for you.

Resources