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
Related
I want to know is it possible to open a facebook group link in facebook app from android webview application build by android studio.
is there any html and JavaScript for that.
With webview in android studio, you can only open links inside your app and not outside.
In your case, you want a facebook group link to be opened in the facebook app which may not be possible using Webview.
That's why you need to use WebViewClient. You need to override shouldOverrideUrlLoading method and start an intetn with the package "com.facebook"
Check this answer: https://stackoverflow.com/a/50293855/12802591
You may need to test if the user already had facebook app installed then open the group link there, if not it will open the group link inside the web view.
Another useful link :
https://stackoverflow.com/a/54589702/12802591
Let me know if it works !
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.
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
I'm trying to implement the official Twitter and Facebook share buttons in my Cordova/Phonegap app, and I'm running into major difficulties with them. Both of them attempt to load an iframe element to display their buttons, which works, but clicking either of them causes them to open in the Webview, with no way to open them instead in the ChildBrowser. This becomes an issue when the user is done sharing but can't go back to the app due to a lack of navigation buttons.
Is there some way to open a list of URLs in ChildBrowser by default instead of Webview?
Well you can use the:
ChildBrowser.showWebPage();
command to open non-white listed URL's.
Coming in 2.3.0 we will overload window.open() in so that you can specify whether or not you want the url opened in the main web view, the OS browser or the special in app browser that does not have access to the Cordova API.
I am using an hybrid android app from geyser.
I want to inform the user about the possibility to download this app, if he enters the mobile version of my website. the thing is, in the app runs a browser which views almost the same content as the mobile website.
how can I detect with JS if I am running in the App-Browser and not on the normal Browser?
I don't want to show the download Link of the App in the App.
Thanks
What you could do is have a javascript function on your page like
setAndroidApp=function(){
isAndroidApp=true;
}
and then, when you load your site through the android version (assuming you're using the Android WebView class ), you could make the function run when loading the page in the following manner
webview.loadUrl("javascript:setAndroidApp()");
in which case, you'd have isAndroidApp set to true for the rest of your code if it's seen from the android app.