Native way to inform user there is a mobile app? - mobile-application

Often when viewing a website on a mobile device you'll get a notification that a mobile app is available, or if you already have the app downloaded you'll have the option to open the URL in the app.
Is there a native way to do this or are these notifications always custom?

When users click on a link or download a file and the suggestion pops up to open the respective app, that's called deep linking. iOS labels it as Universal Links and Android uses App Links.

Related

How to get the URI scheme of any app for AppLinks/universal linking?

I need to open a third-party app from my react native mobile app. I understand that this is called universal linking on iOS and AppLink on Android.
I have done a lot of research for this, and I have been able to set up a link to the third party app on the app store. Now I just need to get my app to open up the app if the user has it installed. That requires the URI scheme of the other app, though.
My question is, how do I get the URI scheme to this third party app? Rather, how do I get the URI scheme of any app? I know the URI scheme of the twitter app is 'twitter://app', but the app I am trying to link to is way more niche than twitter or other popular apps, so there is no help for this sort of thing online.
Any tips?
Finding the URL scheme of an iOS app
Due to Apple's tendency for secrecy, it's not easy to find the URL scheme of an iOS app. But it can be done. Here's how I do it, using a Mac app called iMazing.
Launch iMazing, select a connected iOS device, click Apps:
In the footer of the window, click Manage Apps:
Select the app you're interested in , then select Export .IPA menu item. Note: You may need to download the app first.
The saved file will have the .ipa extension. Change the extension to .zip, and unzip the file. You now have a directory with the name matching the app's name.
Assuming "asana" is the app name, open the file "asana/Payload/asana.app/Info.plist" in a text editor, and search for a section that contains "CFBundleURLSchemes". Assuming the app contains CFBundleURLSchemes (they are optional), it should look something like this:
The URL scheme is in the <string>asana</string>, so the complete url scheme in this case is "asana://". Test that the URL launches the app by typing it into iOS Safari browser window. If it works, Safari should display an alert like this:
What About Apps Without CFBundleURLSchemes?
I haven't found a way to launch apps without CFBundleURLSchemes directly, but you can link to the app's page in the App Store, where the user can open the app with the Open button (or Get button if the app is not installed).
You will need to obtain the app page's URL from the App Store:
Open App Store, go to the app's page, click the share icon:
Click Copy Link:
The URL will look like this:
https://apps.apple.com/us/app/asana-organize-tasks-work/id489969512
Clicking on that link in Safari will bring up the app page in the App Store.
Maybe it is worth to start with some background:
There are various ways to deep link into an app, and it depends on the platform (iOS\Android\WindowsPhone...) and its version.
On iOS, up until version 9, the way to open an app was by using URI schemes, e.g. the one you added above: twitter://app. Each app declares the scheme that should be used. Therefore in order to deep link into the app you wish to open, you'll need to use the scheme that it declared. This is the same for Android until version 6.
Starting iOS9+, Apple introduced Universal Links as the method for deep linking. Here's some information: https://developer.apple.com/ios/universal-links/
In these versions, URI schemes won't longer work when using Safari browser (which is the iOS default browser) if the app is not installed. If the app is installed, however, URI schemes should allow opening the app, if everything is configured successfully. In Android there's a similar method called "AppLinks".
Having said this, the above information is for setting deep link for your app. I do not think that it is a common use case to open a third party app from your app - deep links are configured and used by the app owner (e.g. for publishing his\her app to engage users).

Branch.io : how to remove deeplinking on Quick Links?

I want to create Quick Links in Branch.io that redirect for example :
- either to my iOS list of app if the user is on iOS
- or to my Android list of app if the user is on Android
So I created a Quick Link in Branch.io.
In the "REDIRECTS" tab, I pasted my iOS url and Android url to my list of apps in the appropriate fields, and changes the type of these fiels to 'Web URL'.
My problem if that if the user has got my app on its device, it will open my app and not my catalog. It is because it is written on the 'REDIRECTS' page: 'If the app isn't installed, send users to: ...'
In my case, I want to send the users to my catalog even if the app is installed.
How to solve this problem ?
If you want to open the web instead of the app, please check out the web_only feature: https://docs.branch.io/pages/links/integrate/#open-web-instead-of-app

How to Launch/Open any other external app from hybrid app? [duplicate]

I have a requirement to open the native version of the hybrid app (.ipa/.apk/.appx) when the hybrid app is requested in a device browser.
I am able to detect the environment using WL.Client.getEnvironment(); method, if it is found to be Android/iPad, I want to launch the respective .apk/.ipa file in the device. Any help is appreciated.
Re-reading this question and the comments several times... I still do not understand the actual scenario... it'd be best to rephrase it.
Scenario: How to open an app from the web browser:
If you have added the following environments to your Worklight application:
Mobile Web
Android
iPhone
And when visiting the Mobile Web version of your app, you want to display a message like "For the full experience, open the full application by clicking here".
Then:
It is implied that the user already has the application installed.
If it is not installed, you need to take care of that somehow
The way to handle this scenario is to use URI schemas:
For Android: How to implement my very own URI scheme on Android
This means that after adding the custom URI schema to AndroidManifest.xml, you could then detect the device OS the Mobile Web app is currently running on and display a custom link: myapp://<the URI schema you've defined>. Tapping it will open the app installed on the device.
For iOS, in a similar fashion: https://coderwall.com/p/mtjaeq
Also see: http://wiki.akosma.com/IPhone_URL_Schemes
Alternate solution: If you are not sure if the app will be installed or not, then instead of using URI schemas you can always point to either Google Play or Apple App Store, to the app page; the user will then have either a "Open" or "Install" link.
Scenario: How to open an app from my own app
If you have a Worklight Hybrid application (Mobile Web is not a Hybrid application), and you want to open another application from within it, you can:
Use the same approach of URI schemas, or
Use Cordova plug-ins
I have created this Worklight 6.1.0 project to demonstrate:
Android - How to open, for example, the Android Settings app from your Worklight Hybrid app
iOS - How to check if Waze is installed and open it, and if it is not installed then to open Apple Maps instead.
See instructions.txt in the apps\test folder.
Are you asking that if the user via their device browser hits the webapp version of your app on the internet, the website will ask the user to fire up the native app on their device? kind of like what ebay does?
if that is what you want check out these pages
android:Launch custom android application from android browser
IOS:
iPhone - Open Application from Web Page

How to do FB feed share post without leaving my hybrid app?

I am making mobile app using Sencha touch which will be bundled as native app and installed on devices. In my app on certain pages I want to add "share" functionality which is supposed to post some data to user's feed. While testing on browser I can to do that by opening a window with FB sharing url like "https://m.facebook.com/dialog/feed" or "https://m.facebook.com/sharer.php" and passing all related params as explained in https://developers.facebook.com/docs/reference/dialogs/feed/
But when this app is bundled and I share with this, user is moved to browser and cannot return to app because redirect_uri cannot point to app which is why I wanted to open this dialog within my app, probably in an iFrame. This is also not possible because these dialogs are not allowed to be embedded in iframe by META tags and in order to surpass it I have to do user login which again is another dialog which I cannot open in my app's iFrame.
I also looked at sample sencha app http://blooming-day-7830.herokuapp.com/ but it also takes user to separate login page instead of opening in-app dialog.
So my questions is how does hybrid apps connect with FB without moving out user to browser?
if you decide to use PhoneGap you can try the following two options. You will have to check for the iOS version before you switch your Phonegap call to. . .
Option 1 : for iOS before 6.0
Phonegap has a pretty nifty ChildBrowser plugin that you can use to load the FB share page without leaving the app for iOS 5.0 and below.
Option 2 : for iOS 6.0+
Facebook Share functionality has now been added to iOS. So all you have to do, is call a custom plugin class that you create, and call the standard FB share code using a basic Phonegap plugin call. You won't leave the app, the ChildBrowser doesn't have to show up, instead, you'll get the stock iOS-FB share sheet that will show up, you can add pictures, text, and so on, and post to facebook.

how does Google's "Google search 2.0" app launches other apps on iOs?

I always read that only url-like services can be started from an app in iOs, but now i've seen that the new "Google Search 2.0" app has got a panel where you can tap an icon and open one of the other Google's apps.
If you have not installed that app on your iphone it redirect you to the app store.
The other Google apps have URL schemes registered that can open them. UIApplication’s -canOpenURL: method will return NO if the URL scheme provided does not match an installed application, so in that case they’re redirecting to the App Store link for the app in question.