File uploading in fultter webview - flutter

I am using fluter webview for android and iOS apps. In the app, the page contains an HTML form where one of the fields is file uploading via dropzone.
If I open the page in the browser and press the Choose File button, file chooser pops up and everything is working fine, but when I press the Choose File button in the webview nothing happens.
I am following this github issue initiated by flutter developers - https://github.com/flutter/flutter/issues/27924
Any ideas how to make this work?

Related

How do I make a button in Swift to execute a line of HTML code?

I am working on a small desktop app that will open websites on the click of a button. It's sort of a bookmark launcher in app form. I need to be able to connect a button in Swift to a single line of HTML code and have the button execute the code.
This is not an iOS app, it is macOS only. I am not looking to launch a UIWebView, I just need a single line of HTML executed.
Can anyone help? Thanks in advance.
I don't understand what you mean by "execute html code"
if you have a link and want to open it you can do:
NSWorkspace.shared.open(url:"your url")
https://developer.apple.com/documentation/appkit/nsworkspace

How to have image target new window or _blank using FPDF?

In my app the PDF gets opened in the web page and in the below example, when the users clicks on Logo.png it's getting redirected to FPDF site in the same page, but i want to open the link in the new window, instead of opening in the same window, so the users has the PDF opened.
$pdf->Image('logo.png',10,10,30,0,'','http://www.fpdf.org');
Yes I have tried some workarounds for this but its seem to not possible currently. But I have achieved this using ViewerJS.
Just display pdf using viewerjs(pdf js). Just put this line $('a').attr('target', '_blank'); after div.setAttribute('data-loaded', true); inside viewer.js file.
And you will find target blank. Hope this helps!
Sorry, I am pretty sure that this is not possible currently.

iPhone SDK - Add a "Add to Home Screen" button in a UIWebView

I have a native iPhone app, which has a UIWebView component to it. I am trying to see if I can replicate the "Add to Home Screen" button that is present in the tab bar options in Safari.
Is this possible inside a UIWebView within a native app?
Thanks!
Brett
[I presume your question is about replicating the action associated with add to home screen, rather than replicating the appearance of the button itself (which being pedantic is what you actually wrote).]
As others have said this isn't possible.
What you could do is programatically launch Safari from within your app and give it the URL of a page to load which is your page.
When your page is loaded it has some sort of animation and shows the user where the add to home screen button is and tell them to press it after clicking a link which is displayed in your web page. When the users click on the link it takes them to whatever page it is that you would like saved to the desktop, and you hope they follow your instructions.
If you register your app to handle a proprietary url scheme the users can get back to your app from within Safari by clicking on a link using your app's url scheme.
The web pages that you seed Safari with must however be remote pages, you cannot give Safari a page in your app's bundle or that your app has downloaded as Safari cannot read pages from your app's sandbox.
The short answer is no, you can't. Apple does not let you.
Here's a similar question which may help you come up with other possibilities:
Javascript for "Add to Home Screen" on iPhone?
If I had to think of a work around off the top of my head, you could create an javascript pop-up which instructs them how to. It could say something like tap this button to go to mobile safari then tap action -> add to home screen.
Execute the Javascript with UIWebView's method:
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
Hope this helps.
You can use UIActivityViewController with your url as the activity items
NSArray *activityItems = #[title, url];
And then you can exclude the activities that you don't want. I think it´s the only way for now.

Opening a File Dialog Box when button is tapped in iphone

I did a cocoa application in which the file dialog box is opening when a button is tapped with the use of NSOpenPanel controller in cocoa applications.For ipad applications we are using UISplitViewController.
I want to know that for developing the applications in iphone,what controller to be used for opening a file dialog box when a button is tapped.
For example in composing a mail.In composing a mail,if we want to attach any files from the local drive,we click the "Attach a File" button. Then it will opens a file open dialog box for selection of file what we want.
Can any one help me or suggest me what controller to be used for opening a file in iphone applications?For opening a file dialog box ,in
cocoa applications --------- Controller used is NSOpenPanel
ipad applications --------- Controller used is UISplitViewController
Like wise for i phone applications ------- ??????
Please help me out of this?
iOS doesn't have a concept of browsing arbitrary local files.
It does have the ability to browse for images from the photo library — for that you can use UIImagePickerController.
Other than photos, the only files you can even open are ones that are inside your own sandbox folder (i.e. ones that you've put there yourself). There isn't a built in view controller that will display them — you'd have to write your own that will read the list of files using something like NSFileManager contentsOfDirectoryAtPath:error:, and display them in an appropriate UI.

When a user launches "new window" in a home screen app

When a user launches "new window" link in a home screen app.
In Mobile Safari this type of action would open a new tab. What happens if the app is on the home screen and has name="apple-mobile-web-app-capable", content="yes" active.
Will the window still technically be in another tab, although you cant get back to the original one - or will it just navigate within the current tab?
First of all, unfortunately window.open method does not work at all.
Instead, a < a href="..". >...< /a > works and by default launches Safari and opens the link in a normal browser window (so, if the user wants to come back to the app, he has to doubleclick the iPad key and switch back to it).
You can force the link to open inside the app (so replacing the current page) with the tricks listed here: iPhone Safari Web App opens links in new window
Hei, I found a brilliant way to have a "window.open" effect in an iOS webapp too!
It loads a page in a Safari tab and has solved my problem, maybe it can be useful to others: http://webdeveloper.com/forum/showpost.php?p=1161159&postcount=14
It's also a great way to avoid the popup blocker (the blocker would stop a window.open(url) call but it doesn't stop that method) :-)