Open mobile app (if installed) using javascript (without intent) - javascript

From web browser, I want the ability to open any app if installed (such as facebook, twitter etc) using java-script. I can't update intent file, want to do it solely from java-script. Is there a way from java-script to detect the installed apps (from IOS & Android) and open it?

You can use Firebase Dynamic Links https://firebase.google.com/docs/dynamic-links
It was designed to resolve the issues like yours.

Related

Web App runs inside Webview and installed like a native App

I created a Web App(PWA) via React and Bootstrap. It runs perfectly. I planned to create an Android and another iOS Apps that have only one page with a Webview that loads my Web App via URL and ship those Apps to the customer.
My question is that there is a better and standard way to this? I heard about Hybrid Frameworks like IONIC but as I understand, IONIC Apps, Are web Apps that run on device not loaded from a URL, Is that right?
What I want is that my changes in the server affect all users and Apps installed on their devices. Because of that, I created the PWA App, not the Native App. I searched a lot but I can't reach a final decision.
Used to be I was an Android developer and had a lot of problems with shipping the latest version to the customer, Now I want to use Web-based technologies to reach Apps that works like a website.
The issue here is: you will not be able to use the devices resources if you load the PWA in a Webview. For example push notifications will not work. A PWA can be installed onto a phone and windows as an application. This will have push notification on Android and Windows but not on Mac or iOS (Safari is the new IE). You need to go Hybrid or back to Native if you need more.
You are right with IONIC. It is a wrapper for a webapp stored on the device but it allows us to use native features (push works on both Android and iOS). But you still have the distribution issue since you need to publish to the stores every version. Not even mentioning the hoops apple gets you through when you try to publish.
The good thing with IONIC is you have a single source code for multiple platforms and you can choose the library you want to build with. It used to be Angular but now you can choose ReactJS, Vue, Angular or ES. Which makes it way friendlier.
With IONIC you could build the native features and lazy load the rest as dynamic component from a url: stackoverflow question if you do not care about backward compatibility.
I did both PWA and IONIC. Both has their pros and cons.
If I do not care about iOS and Apple I would stay with PWA otherwise IONIC.

Single Sign On through IE

I'm currently building a web interface that lists a load of data for data entry to peruse through. The website doesn't actually update our back end though. We have a vendor supported custom built Windows application which we use for our data entry.
This web interface is replacing some excel lists + VB. The Excel version of this system is able to pass some data to an already open instance of a custom Windows application and bring into the app a certain ID that's clicked on in Excel, so I'm trying to replicate this from the browser.
So far I'm able to get close by using this JavaScript within IE:
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run(pathToApp, 1, false);
}
RunFile()
</script>
But this method I believe tries to open a new instance of the Windows Application. Not access the currently open version. I think looking at the VB code I need to use the windows "sendKeys" method.
It's not something I've ever done before, or needed to do. So It's very new to me.
Is it possible to pass data to an already open Windows app via a browser?
Are there any other options available, I was thinking maybe Electron could help here maybe? Or am I wrong and fighting a losing battle on this front?
Scenario sounds really complex but maybe you should check if this windows app can be integrated with Office Add-Ins.
From their site:
What can an Office Add-in do?
An Office Add-in can do almost anything a webpage can do inside the browser, such as the following:
Extend Office native UI by creating custom ribbon buttons and tabs.
Provide an interactive UI and custom logic through HTML and
JavaScript.
Use JavaScript frameworks such as jQuery, Angular, and
many others.
Connect to REST endpoints and web services via HTTP and
AJAX.
Run server-side code or logic, if the page is implemented using
a server-side scripting language such as ASP or PHP.
In addition,
Office Add-ins can interact with the Office application and an add-in
user's content through a JavaScript API that the Office Add-ins
infrastructure provides.
Web app
The minimal version of a compliant web app is a static HTML webpage. The page can be hosted on any web server, or web hosting service, such as Microsoft Azure. You can host your web app on the service that you choose.
The most basic Office Add-in consists of a static HTML page that is displayed inside an Office application, but doesn't interact with either the Office document or any other Internet resource. However, because it is a web application, you can use any technologies, both client and server side, that your hosting provider supports (such as ASP.net, PHP, or Node.js). To interact with Office clients and documents, you can use the office.js JavaScript API that we provide.

How to open an external app in Cordova/Ionic?

I'm working on an ionic app. In my app I want to have a button that will open another app. I tested the hyper link in safari and the link opens the app correctly, but when I click the button inside my Ionic app, it's not working. The Xcode reports
Failed to load webpage with error: The URL can’t be shown
Any suggestions?
If you are trying to use externally hosted web application in your cordova application, check out cordova-hosted-webapp-plugin. The plugin enables using content hosted in a web site inside a Cordova application by providing a manifest that describes the site. Also it lets you use the features of Cordova plugins too.
But if you are trying to just invoke the external web URL from your cordova app, you can make use of cordova-InAppBrowser-Plugin which opens the web URL inside the app itself.
You can also check out cordova-themeable-browser-plugin which is almost similar to InApp browser plugin and provides more control on the browser elements available in the UI. Hope it helps

detect Android app is installed or not in device using javascript or jquery

I build a webapp and I have social links in my webapp.
I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.
And incase if I doesnt have any native app installed then it should automatically redirect to browser.
Here it is the code what I have tried:
Javascript:
if(isAndroid){
fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}
How do I handle this urls...
Please help me out.
This is not possible, for privacy reasons.
See This answer
You can make Hybrid Application.
What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.
So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.
You can do it easily. Start Here:
https://developer.android.com/guide/webapps/webview.html

Can I create HTML 5/JS application that calls windows phone 7 silverlight app

I want to build 1 UI for several phones (windows phone, Android, IPhone, etc).
My plan is to create an HTML5 UI, and use JS to invoke applications that are installed on the mobile device.
For example, I create windows phone 7 application without UI, and invoke functions of this application from the JS in the HTML 5 UI.
Same goes for android, IPhone, etc.
Is this plan feasible at all?
- How can I call windows phone 7 silverlight app/Android from JS?
Calling a native app from the browser is
possible on iOS: Opening Native App. from Safari
possible on Android: Launch custom android application from android browser
impossible on Windows Phone 7
On iOS, you can't create a web app that calls native code, period. You mention that you want the app to have no UI, so I'm assuming you want to have a web app that invokes native code which in turn causes something to happen in the web app, or even causes something to happen on the device. Won't happen. You can use the iPhone's Custom URL Scheme to LAUNCH an application with given parameters so that when it opens it immediately does something, but you will get kicked out of the browser and in to your app. And App Store Guidelines wouldn't let you make an app that has no UI. It also doesn't allow for the creation of apps that are just WebViews wrapped around HTML.
On Android, I would imagine that you could create an app that is nothing more than a WebView that loads your webapp, and in that way you would have access to the native code you wrote for the device, but I don't think that would meet up in the middle the way you want it to when it comes to having the native code manipulate your web app. Plus Android UI's are mostly XML with a little bit of backing code so at that point you may as well be making a native app.
The browser in Windows Phone 7 does not currently support HTML5, though it is expected to arrive later this year. That said, I would extremely surprised if there was ever a public API that enabled a web site to open an application on the host device and I'd be surprised if this was allowed on Android or iPhone, too.
The only application that I'm aware of that exhibits this behavior is the YouTube application. If you visit YouTube.com on the WP7 browser, then it either launches the YouTube app if you have it installed, or prompts yout to download and install it. So, the capability is there, but I doubt very strongly if Microsoft would ever open it up beyond a close partnership for specific applications.
In Windows Phone 7, you can use the WebBrowser control within an application to host/browse web content, and from the application you can call javascript methods exposed by that page as described by Shawn Wildermuth in his Navigating with the WebBrowser Control on WP7 post.

Categories