Open pdf/doc/xls in other iphone app with modification acknowledgment - iphone

I know how to implement inter-app communication. I did it with some examples.
Now I need to send/share a doc/xls file with other application in my iPad/iPhone that have url schemes to open in such files.
Questions
How Can I find the list of application that has url schemes to open such files.
How can I limit the open-in in some specified application with in the above list.
Important
How can I prevent the shared document from further sharing (such as email/print).
And if the shared file is modified by that application how can I know it.
How can I get back the shared file after modification.
While sharing is there is any option to make it as read-only,read-write privilege.

In general, it is impossible to prevent a document from being shared. You can only make it more frustrating.
Everything else depends on the URL scheme you are using. For example, if it is the file:// scheme then access is controlled by the OS and filesystem. If it is the http:// scheme then access is controlled by the HTTP server, etc.

Related

A method for linking a server side file to a Squarespace page?

I'm trying to build a website on Squarespace, in which the site links to a database file. It's stored in a standard file system on a server tower with cluster. No SQL architecture or anything that I explicitly know of. Unfortunately Google Drive isn't an option due to the size of the file ( > 200 GB). I'm rather lost due to the size constraint -- does anyone have an idea about how to do this? Can I set up some sort of server query using a link on the site? Can I upload the file from my computer and store it somewhere in the backend? Thanks.
"...the size of the file ( > 200 GB)..."
Unfortunately, Squarespace's own upload limitations are far below this for the two places where files like that can be stored: file storage (20MB) and developer-mode '/assets' folder (10MB). The CSS-/Style-related storage only supports images (and likely has a limit of less than 20MB). Digital download products can be 300MB (still to small for your file) and likely can't be linked-to and accessed as you'd need for your application.
"...Can I set up some sort of server query using a link on the site?..."
If you mean a query on some other service besides Squarespace which connects to the file hosted on your Squarespace site, the answer is no simply because there's no way to upload the file to Squarespace due to its size. If, however, your mean a query from your Squarespace site to the file hosted elsewhere, then this must be done using JavaScript and done entirely client-side due to Squarespace's lack of support for server-side languages.
"...Can I upload the file from my computer and store it somewhere in the backend?..."
See the options mentioned above, though all have file size limits below that of your file.
If you are able to utilize the file on your site using client-size/front-end JavaScript only, then perhaps you could host the file on Amazon S3 or other such provider and access it that way.

Continuous sync of dropbox files to third party app

I am looking for dropbox apis which will serve me to sync all/specific files into third party app. I have explored core API and Sync API but couldn't figure out right strategy to implement this scenario.
Use case details :
user grants dropbox permission/connects to my app.
User share set of existing files to app.
If there is any changes happened to the set of files shared with app, i should able to identify them without downloading the files again.
I have come across some applications(ex: zohodocs) which continuously sync files from dropbox to their application. Are they continuously check all files in the dropbox user account to find the changes. What is the effective way to doing this.
Also please suggest appropriate API's without violating user security by granting more than required permissions.
The answers depends on what kind of app you're building and where it runs.
For client-side apps (JavaScript in the browser, mobile apps, desktop apps), you should be using a combination of /longpoll_delta and /delta to find out when files change and then what the specific changes were.
For server-side apps where you're monitoring a lot of user accounts at the same time, you should be using webhooks to get a notification when files change in a user's Dropbox, and then /delta to get the specific changes.
In terms of permissions, the options are here: https://www.dropbox.com/developers/reference/devguide#app-permissions. Without knowing the specifics of the app, it's hard to tell you which permissions you'll need to use.
EDIT
I should add that, in the case of a client app, the Sync API automates the /longpoll_delta-/delta loop. You instead just add listeners/observers to get notified when files change.
We have the same use-case and poll dropbox every 15 minutes by calling the /delta service
https://www.dropbox.com/developers/core/docs#delta
This is very efficient. We are using our own library for this, https://github.com/rmuller/dropbox-java-client.

Wireless updating in objective-c

I have an application in the store that has a bunch of UITableViews, each has a bunch of items that when selected, load a UIWebView that loads a local HTML file. The reason I do this is so it allows for viewing when there is no internet access, however it makes it tedious to update.
How would I go about both keeping local files, and keeping web files, so that If I update one on the web it would let the user know there is an 'update' and it can download and overwrite the old file with the new. Is this possible? Like I would make myself a backend to edit my HTML, and have a connection to the app so whenever I clicked save the app would know to ask the user to update the files so I don't have to submit to apple for such small updates.
But I still need to allow offline viewing in case they didn't have internet access.
What technologies or techniques would I have to research to accomplish this?
Thanks
what you're looking for is an html5 concept called application cache.. it directly addresses your problem. With app cache you can cache static content at the client side, which they can view even if they're offline, yet they can update it when the content on the server changes. If you look around you'll see people use this for the iPhone as well.
update:
What way would I go about rewriting files on the phone from ones on a server?
you basically update the cache to do that. from the docs:
The application cache automatically updates only if the manifest file
changes. It does not automatically update if resources listed in the
manifest file change. The manifest file is considered unchanged if it
is byte-for-byte the same; therefore, changing the modification date
of a manifest file also does not trigger an update. If this is not
sufficient for your application, you can update the application cache
explicitly using JavaScript.
I encourage you to do some reading on html5 local storage just to get the concept of local cache and manifest files etc, then just follow through the instructions on the apple docs.. It's not that difficult.
You can cache the content as abbood said but that won't allow you to provide initial offline content.
Another approach would be to use NSURLProtocol, which allows you to swizzle a request. For example, if you have a request for "http://google.com", you would be able to either change the URL or load your own content (say from a local directory).

How to get the language-setting of an iPhone OS device visiting a web page?

I'm trying to create a web-page intended to be viewed by an iPhone OS device. Is there a way to retrieve the current language or some locale-specific data when a user visits on an iPhone OS device? I want to set the web-page language according to the local or language of the device. So, how can I get the language-setting of an iPhone OS device visiting my web page?
Try using the "Accept-Language" header sent by the browser to the server. It should be something like "en-us" or "fr-fr", etc. depending on the language setting for the device.
iPhone indeed sends reasonably correct Accept-Language as seen from this email.
(However, it's strange for me that it sends only fr-fr. It appears more reasonable to send fr-fr, en-us;q=0.9 and they might change into that in the future)
But the more important information for you is that you don't really need to do anything complicated in your situation. This is called content negotiation and is standard feature of Apache and other servers -- they will automatically return page in the language user prefers with minimum configuration.
You do need to create different pages at different URIs for different languages. If you don't, you're breaking the idea that any content has an URI that can be easily passed to another person and that second person will see exactly the same content even if his/her language is different.
How Apache does it. You create
example.fr.html
example.en.html
example.de.html
(and edit .htaccess file). Then /example returns page in user's language while /example.fr always returns French. As an added bonus, you don't need .html.

iPhone and HTML5 Cache Manifest

I am trying to build an iPhone web application using ASP.NET. The page is dynamically rendered once for each visitor. At this point the page can be bookmarked and it will never change again for that visitor. For this reason it should be cached locally from that point on so the application will run if referenced from the bookmark even if no network connection is available. No matter what I try the phone continues to request the page from the server forcing a re-render or it fails if the phone is offline.
Louis Gerbarg suggested in this post that I use HTML5 Cache Manifest to get this working however following the w3.org docs does not appear to work for the iPhone. Does anyone have a good example where application cache is working?
The cache manifest file has to be served with a 'text/cache-manifest' mime-type. This is absolutely critical, it will not work without it. If you navigate to the url of your manifest file, it should trigger a download...
Also, I've found that putting the manifest location in the tag as an absolute location, as well as all the entries in the manifest file to be more effective.
I answered your previous question related to this, but it was not clear from that question that you were trying to cache dynamic content. The cache manifest is for getting static content you want for offline web apps to work.
I am not sure you can do what you want. Do you want the app to be able to function offline, or are you just trying to peg something in the cache because it is slow to download? Unless you are actually constructing an offline webapp (which the user will add to as a bookmark or an app in the Spring Board) then your page can (and must necessarily) be evicted from local storage at the browsers discretion, regardless of how loose a cache policy you set on the page.
You should use the Safari Javascript Database API which should work for iPhone and Safari 3.1. It works great for local caching and data storage:
http://developer.apple.com/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/
It could be to do with the size of the output.
I can't talk from any serious experience in tweaking things specifically for an iphone, but there is an intersting read from the YUI team here: http://yuiblog.com/blog/2008/02/06/iphone-cacheability/, which indicates that the largest unzipped cache file that can be held in an iphone is 25k, and that for optimal caching, as many components as possible should be <25k.
That may be the cause of your problems, but that's only a guess.