Part of an app I am working on needs to access an external website to answer a few questions.
When that is needed, I am opening a web view and the URL set to this site. The page loads fine, but there is no way to interact. The textfields cannot be edited and the buttons cannot be clicked. To make sure it was not my website (works from iOS safari fine) I pointed the web view to www.google.com and cannot click the search button there either. Basically:
var webView = Titanium.UI.createWebView({url: 'http://www.google.com'});
win.add(webView);
win.open();
Is there some trick to being able to interact with the website through a web view? At this time I cannot use a native app and web service and need to get the app working with the existing website to fill out this form.
Titanium Studio 2.1.2 and iOS6
Maybe are you putting some View (Ti.UI.View) after putting the WebView in the Window?
Related
I'm getting back into Xamarin.Forms, and I've discovered a new behavior of iOS 13 Safari on the iPad called "Desktop-Class Browsing." It's covered in detail here:
https://developer.apple.com/videos/play/wwdc2019/203
The problem for me is that I need my Web application to be able to detect if a normal Web browser is viewing it or if it's being viewed by a Xamarin.Forms.WebView. From my Web application, I used to be able to detect a Web view with the user-agent string or with the X-Requested-With header. But if my Web view is running on an iPad on iOS 13, it will enter desktop mode, which yields a desktop Safari user agent a no X-Requested-With header, and I can no longer detect that it is a Web view. This is referenced at 2:56 in the above video.
In a native iOS application, I can apparently use WKWebViewConfiguration to control these desktop-like featuers:
https://developer.apple.com/documentation/webkit/wkwebviewconfiguration
I think this is demonstrated at 9:01 in the video in my first link.
How can I use WKWebViewConfiguration with Xamarin.Forms? I see a WebKit.WKWebViewConfiguration class, but how can I utilize it with Xamarin.Forms.WebView?
Unless you follow the steps in this article, your app is using UIWebView instead of a WKWebView
There are several ways of getting access to editing the WKWebViewConfiguration:
You can use a "Custom Renderer" to implement your own WKWebView as shown in this Official Xamarin Forms example, and edit the WKWebViewConfiguration there.
Another possible way that I haven't tried- You can also implement a WKWebView inside your forms using the steps mentioned here. And then just edit that property.
I found a lot of tutorials about opening an app by a custom url scheme like:
myappname://
Thats nice but it would be great to open an app by registering the real app domain over the http link like
http://www.myappdomain.com/blablabla
So - for example - if a visitor comes to a webpage (on her/his mobile) it is normally opened in the browser, excepts the installed app is listening to the opened URL and opens itself instead of the browser.
How is this done (i've seen this at another app). Any help would be great. Thanks in advance!
It is a new feature in iOS9. It is explained in the WWDC15 talk Seamless linking to your App.
You could also add a small piece of javascript to each page that opens your custom URL-scheme.
I'm using PhoneGap with AngularJS framework.
I want to display a web page. I tried to use iframe but scroll isn't working.
I want to keep this page inside my app and not as a in app browser or external browser.
My app is running on iOS, Android and WP8 both.
Some help please :)
Thanks in advance
function loadWebView(pid)
{
var url = "http://dummysite.com/index.php/catalog/product/view/id/"+pid;
$("#div_load_page").html('<object data='+url+' class="webview"/>');
};
This is simple jQuery I've applied in my phonegap application which gives me the desired result. Scroll bars are visible and depend on site's responsiveness and size.
See Result.
when we click on a link to our site, www.tekiki.com, from inside the twitter iphone client (search for tekiki.com on the twitter mobile client), the site appears in a boxed area.
is this an iframe or something we can break out of? we tried iframe-busting code, but it fails. we suspect this is a uiwebview. if true, can we bust out and open the site in safari/chrome via javascript?
When you click on a link within the official Twitter iOS app, it opens up a new modal view that contains a UIWebView. There is no way that you can break out of this view and into a different app since Twitter controls the experience. iOS only supports fast app switching via registered URL schemes such as fb://1234567890, not via javascript, etc.
The only way would be if they had an additional button that gave the user the option to open the page in a different app.
I try to create a hybrid Worklight app to aggregate multiple external Portal pages. There is a tab bar and each view in the tab bar loads its own WebView to display a different Portal page. This works fine and I have everything running but Worklight does not load in the Webviews. I want to access Cordova features like the camera inside the Portal pages.
Worklight initializes fine when I load a Portal page directly in the master Webview, but it does not load in an embedded Webview, i.e. all necessary Worklight files are there and the Portal page is set up right.
I enhanced this example:
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v506/09_06_Integrating_server_generated_pages_in_Worklight_applications.pdf
This is the important part of the code:
webViewOverlay = new WebView(this);
webViewOverlay.setWebViewClient(webViewClient);
webViewOverlay.setWebChromeClient(new WebChromeClient());
webViewOverlay.getSettings().setJavaScriptEnabled(true);
webViewOverlay.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webViewOverlay.clearCache(true);
webViewOverlay.loadData(""http://mymielke.de/test/portal/test.html"", "text/html", "UTF-8");
At least from reading your text, it sounds - to me - like what you're trying to accomplish is nothing like the sample you are basing it on?
The sample is a Worklight Hybrid app with three tabs, the first two simply load some HTML and JavaScript resources that are bunnled in the app (hence are in the Worklight instance and can use whatever the app holds in it, including PhoneGap functionality), and the third third tab is a WebView Overlay that loads an external website.
If this external website wants to access device features using PhoneGap, then PhoneGap needs to be local to the website that is hosted in the external server; Worklight-provided functionality (this includes PhoneGap), will not be available to this external website.
But, then you write:
Worklight initializes fine when I load a Portal page directly in the
master Webview, but it does not load in an embedded Webview, i.e. all
necessary Worklight files are there and the Portal page is set up
right.
Where is "there"? On the external server? There is no reason for Worklight to function this way, as it is outside of the Worklight app scope. You cannot expect to have "multiple" Worklight applications within the same application, loaded so-called remotely(?). (well, you can expect it if you want to :), but it doesn't work that way...)
Have I understood you correctly? If not, feel free to edit your question and make it clearer.