Download PDF from Meteor(react) iOS mobile App to Device - ios

I have a weird problem with my Meteor(react) iOS mobile App. The problem is that I have to download PDF document in my app through button provided by react-html-table-to-excel npm package and when I click the button, it shows me the PDF document with no back link.
My piece of code,
import ReactHTMLTableToExcel from 'react-html-table-to-excel';
// this is the button to download pdf using id of table
<ReactHTMLTableToExcel className="fa fa-download btn"
table="listOfUsersDwnld" filename="listOfUsersDwnld" sheet="tablexls"/>
<table id="listOfUsersDwnld" className="table">
</table>
Hence, when I open the PDF document in my app through a button, it takes me to a dead end and there is no way I can go back to the main page of my app.
Also added npm cordova "cordova-plugin-file" package. But still no breakthrough.
It is working in browser but not in ios-application. Earlier it was not even opening pdf but then I added allow navigation rule and since then it is opening but unable to download.
My question is that how can allow downloadable pdf file in iOS? Any internal element for the iOS may be?
Thanks in advance.

Related

Error when distributing an IPA over the air with dropbox

I am using dropbox for distributing my addhoc builds over the air.Till last week it was working all fine.From this week the html page does not open in safari browser in iphone. Instead it is showing following message
One more thing i would like to mention is i have an app called iZip installed on my test device.So open with iZip option pops up for opening it in iZip,but when I do that the html file loads fine.I searched for this issue but didn't found any solution yet.I also found out that since iOS 9 apple has made changes in opening url schemes.So would that be a problem or some more additional things we need to add.I am testing this on iOS8 and iOS9
I just found out a sad news from this url Discontinuing rendering of HTML content
that dropbox has dropped the support of rendering html file content in browser.So have to look for another way to deploy my build over the air.
Update 1
I have found workaround in which HTML page wont be rendered but still your build will get downloaded successfully.So here is what we have to do now
In our html file we have code like this
itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/9pj4sds3r9k4nlmn/testApp.plist
copy whole thing and paste it in web browser,pop up will appear saying "Open this page in App Store"? just say open and after 4-5 second another pop up saying "dl.dropboxusercontent.com would like to instal .app" so click install and build will get installed.
I think the URL your are using in your browser is the URL to download the HTML file ( due to dl.dropbox ... )
You should find an other url that let user display it ( look for share link )

How to make app intent for iOS app to download pdf externally?

I have wrapper app with some buttons to generate PDFs.
I would like to download PDF files to be opened by Adobe, now when I click on the button it open it within the app which make it unable to get back and I have to force closing the app.

Pressing delete draft or save draft and the mail preview screen doesn't disappear. IOS Phonegap

I am currently developing a Phonegap application for both IOS & Android.
The problem (wall) I have come up against is that when I open a generated .pdf file in my app and get the standard "Select Your Application" IOS Pop-Up, selecting Adobe Reader will fire Reader up as a new instance (which can be closed as/when). But if I select Mail It fires up in the same instance, and there is no way back to my application (save for closing and restarting).
This is a screengrab of how my app looks once mail is opened, as you can see the cancel button gives limited options (sorry not enough rep points to post image here).
https://cloud.githubusercontent.com/assets/2068157/5375252/b768577c-805f-11e4-9f43-e2026d5800da.PNG
I am currently using Fileopener2 and have raised the issue over on the Github, but I am wondering if it is simply IOS related regarding the Mail app.
I have tried using in app browser and injecting code but again the mail app just overlays the inappbrowser and its "done" Button, meaning I still cant return to my app.
Thanks in advance.
Edit: I am using IOS 8.1.2 - Phonegap v3.6.3 and the Fileopener2 Plugin: https://github.com/pwlin/cordova-plugin-file-opener2 also tried Cordova-bridge/open plugin: github.com/cordova-bridge/open/

Opening a local file with InAppBrowser under iOS doesn't work

I am developping a mobile application using Cordova. This application allows users to navigate in a kind of a file manager and allows them to download files. I use the plugin "FileTransfer" to download the file on the user's device and then call the InAppBrowser (version 0.5.2) plugin in order to open it.
While it works really great under Android, I can't say the same under iOS (tested under versions 7 and 8).
This is the line of code I use to open the downloaded file:
window.open(entry.toURL(), "_system");
Under Android, it proposes the user which application he wants to launch to open the file or launches automatically the default application based on the file extension. Under iOS, the file is downloaded and then nothing happens. I have found out I could use the integrated viewer of the InAppBrowser plugin when the user is under iOS. I do that in this way:
if (navigator.userAgent.match(/iPhone|iPod|iPad/))
window.open(entry.toURL(), "_blank");
else
window.open(entry.toURL(), "_system");
With these lines of codes, if the user is under iOS, the integrated viewer is launched and displays the file. The problem is for ZIP files or other files that can't be rendered in the viewer. This one says "Load Error".
I think that if "_system" worked, Safari would be launched and would propose the user how he wants to open the file.
Does anybody have an idea of how I can make "_system" worked in iOS? Is this eventually a known problem (I couldn't find anything related to my problem)?
If this can be relevant to my problem, I use Phonegap Build in order to generate the .ipa file.
On iOS when you use _system, it try to open the url you pass with safari.
As iOS have sandbox access limitations, safari can't open the url because it's inside your app sandbox.
You can try this plugin, it provides an "open with" dialog that will show you the apps that support the type of file you want to open if any available.
https://build.phonegap.com/plugins/1076

Upload from embedded UIWebView using ink filepicker

I have a website that is using ink's filepicker javascript lib to upload photos. It works in browsers on both desktop and mobile, the difference is on iOS it will open up a separate tab and upload from there and return to parent tab once upload is done, but on desktop it just opens in a modal view.
Now I am embedding a UIWebView in an app so there is no tabs. The page where upload button is will be replaced by the filepicker uploader, and I was expecting it to preserve the state of it's parent page, but somehow it won't. I am unable to upload even though the same upload button works in the same simulator in browser. Do I have to use the filepicker iOS library for this kind of in-app upload? Are there any work-arounds? Thanks.
I have the same issue with embedding my JavaScript/Filepicker based site within my native iOS app in UIWebView.
I contacted Filepicker.io dev support and here is their statement:
"unfortunately the way it looks currently is that the limitations of UIWebView prohibits cross-window communication, because as you're seeing the state of the parent window is not saved."
So, I am going to have to use native Filepicker library as well on iOS.

Resources