Save HTML, CSS + Images for offline usage - html

My iOS app needs to work completely offline if the user downloads all the data. Some views are mobile websites, so all I do when a user views a website online is download the URL from the database and display that in a UIWebView.
However when the user decides to download all the data for offline usage I need to display that webpage offline.
I tried
NSData *myPagedata = [NSData dataWithContentsOfURL:[NSURL URLWithString:#"http://www.domain.nl/"]];
and then display that data in an UIWebView
[_webView loadData:myPagedata MIMEType:#"text/html" textEncodingName:#"UTF-8" baseURL:nil];
But that doesnt save CSS and images.
I also found out that ASIWebPageRequest can do this but thats a dead project. Does anybody know how I can display a webpage offline with CSS and images?

You might take a look at AFCache. https://github.com/artifacts/AFCache
I have not tried this library but it looks promising.

Related

HTML Folder to an IOS Application/XCode

I have a folder for a functional HTML website that has the CSS and JS all zipped up together. My goal is to get this information displayed on an IOS by any means whether through browser or an application. The process that makes this difficult is that the website in the zipped up folder can not be hosted for security reasons. I have tried downloading the HTML zip on to my device and displaying it their through the native browser to no luck. Most tutorials suggest hosting the information and displaying the information through a web viewer provided by xcode; however I cannot host this information, needs to able to be viewed offline. What's the best way to get this done?

UIWebview not render and only shows html content

ScreenShot.png
I use UIWebview to load a remote page generated by nodejs.
[self.webview loadRequest:request];
Page is rendered correctly in the first load, but not rendered and the UIWebview shows weird HTML source code after reload. I tried to change any kind of cache policy, but is still not able to fix it.
Anyone encountered same issue before?
Many Thanks.

instagram app-in browser image Can't upload

I'm sorry. Because I am using a translation machine, understanding may be difficult.
It is a web developer working in Japan.
If you do the following operation, a bug will cause a bug in the instagram.
Send the URL in 「direct」 in the instagram.
(iPhone Application)
(There is a form with in the URL.)
(LIKE http://nervgh.github.io/pages/angular-file-upload/examples/simple/)
Click URL from the 「direct」 and the URL opens in app-in browser.
When uploading a file (image) with Form, the page will be reloaded and the entered file will be deleted.
You can upload the same URL in public browser without problems.
We could not add multiple or accept = "image / *" attribute to .
File upload control not working in Facebook In-App Browser
It is an innovative function of my web application and I really want to fix it
Is not there any good way

WeChat does not redirect to iTunes app store on iPhone

So I have a website with functional redirects to both the Google play store and the itunes store. Using the WeChat messaging application I can open an in-app browser to view the webpage and do everything I normally would.
The problem surfaces when using WeChat on an iPhone. I can see both links and click on either of them, but the itunes link does redirect as desired. Keep in mind that this is not a problem on Android, both links redirect properly inside the app on my Android phone.
The goal is to have the button open up the actual itunes store app, and not link to the itunes webpage but even using itms itms-apps the connection doesn't go through. On said iPhone in Safari and Chrome, these buttons link properly. It is only in WeChat that the itunes redirect button does not work.
I've tried adding an additional page that the button redirects to, which is
<meta http-equiv="refresh" content="0; URL='http://itunes.apple.com/us/app/myapp/myappid'" /> but it just loads the blank the page and freezes because of the failure to redirect. In fact, simply trying to load http://itunes.apple.com in the app results in failure.
Perusing StackOverflow I found this post about linking to the app-store but none of the answers really helped.
So I'm hoping some one has some idea of what to do or has some experience with a workaround for a situation like this since WeChat is integral to my app's performance.
Update:
I still haven't found a solution to my problem, but I've managed to get a lead. The only link to iTunes that works in any way is http://mzstatic.com, but the problem is that I can't seem to find the proper parameters to link to an app. Everything that I've seen online seems to show using the link to grab images.
check this issue
Guiding your user to scan QR code , you can generate your QR code by using this service , adding your appsto url to the QR code (open App Store , find your app , click share , click copy link , you can get your app redirect url offered by Apple);
Register your mobile application on Tencent's Application Treasure,click the Micro Download to apply for you app , add your app store url to generate your Micro Download url which will redirect to app store , the offical document are here mobile application access
so , have a try , hope it helps.

How to view a pdf file in the browser,when clicking on a link

I have developed an application using HTML 5. To make the application compatible with the mobile devices I have used cordova/phonegap.
Now the problem is that, the PDf files which is there inside the application is only getting downloaded, when clicked on the link. I need to get it opened in the browser, when clicked on the link. It works fine with the PC. But not with the mobile devices.
I stored the link to a variable and passed that variable to google. Now using some sort of services from google, the link is getting opened in the browser.
I tried installing inAppbrowser plugin also.
window.open(Furl, '_system', 'location=yes');
This was the line of code used, where Furl is the name of the variable, into which, the url address of the pdf file is passed.
This line of code works fine, when url address of a webpage is passed to the variable. But not with the pdf files.
Apart from that idea, is there any other solution for this problem?
Can someone help me out with this problem?
-Thank you
As stated already on a comment, it is possible on modern browser since they have in-built PDF viewer. This isn't the case for Android or iOS currently. What you could do is to convert the PDF to PNG image and then show that. There is a PDF2PNG plugin available for this purpose. Also, if you only need to support iOS 6 & 7, you can take a look at the PDF Viewer plugin.