1

I developed a hybrid app and I want to display the Evernote content in my app. To achieve this, I used an tag and use the iframe to load the evernote html content. the hybrid app and the iframe area

It works in the Android platform. I can download the note as html file using Evernote Android SDK, then use the iframe to load it.

But in iOS platform, the note content generated by Evernote iOS SDK is a .webarchive file, I tried to load this .webarchive in the iframe, but it did not work.

So, I was wondering if it possible to download the Html files using iOS SDK? Help will be greatly appreciated:D

cococurry
  • 63
  • 3

1 Answers1

0

A .webarchive file is a binary property list that bundles up all the data for the page, including the HTML source that you're looking for (as well as referenced images etc that are part of the note). You can load that entire web archive directly into a WKWebView using the -loadData:MIMEType... method while specifying the correct MIME type for the content (it's application/x-webarchive).

If really want just raw HTML source, then you can inspect the binary property list and pull out what you need. If you're loading arbitrary notes this way, however, you'll need to do all the work to resolve the embedded images etc. The format of a web archive plist is pretty simple but I'm not sure it's publicly documented anywhere. You can look at the Evernote SDK's code for assembling the archive to get a sense of the dictionary keys.

Ben Zotto
  • 70,108
  • 23
  • 141
  • 204