How to use Document Provider Extension? - ios

I was learning a little more about ios extensions, such as:
Today Extension
Photo editing Extension
Action Extension
Custom keyboard Extension
In all of them I did not have difficulties in learning, but recently I try to learn the "document provider extension", and to my surprise not found any relevant tutorial on the Internet talking about how to use it (step by step as the others).
The only alternative I found was use the documentation, and I learned that he can access shared documents from other applications, and you can also share your own existing documents within your app.
The only tutorial I found on the net was the site MacStories but he use iCloud, and in this time I not want to use iCloud, I want do to like documentation says:
allows other apps to access the documents managed by your app (Without iCloud)
In my case I already know how the "provider document extension" works, and so managed to create a new target type "document provider extention" and only that. Anyone know how this extension work?

http://developer.xamarin.com/guides/ios/platform_features/introduction_to_the_document_picker/
or watch the following session from WWDC
WWDC 2014 session 234
Also one of the best could be ios8 by tutorials book on raywanderlich.com but this one is not free

I am also looking for the same. There are not very much good tutorials on this topic. I'll share Some of the links that i have found.
https://github.com/D2B-Solution/DocumentPickerSample
https://github.com/ikuya/DocumentProviderSample
https://github.com/pavanSaberjack/PIDocumentProvider
https://github.com/imayaselvan/DocumentProviderExtension

Related

How to modify a ShareViewController so that choosing an app in the share sheet results in saving media and launching the selected app?

The ability to import media files from various apps (like Photos, Files, WhatsApp) to an app I am building (referred to as "My App" from hereon) using a share button is what I am seeking to achieve.
The user interaction process should be as follows:
Step 1: Select media file from any app
Step 2: tap share button which should list "My App" among others
So far, I have been able to get my app listed on the sharesheet sorted based on this article. I have also looked at this post that makes use of SLComposeServiceViewController which caters to the more of a social media like popup from a sharesheet. Neither of these have helped reach a solution.
However, I am unable to achieve my desired outcome from user action of selecting "My App" from the sharesheet, which is:
a. have selected media copied into a directory accessible to "My App"; and
b. launch "My App" in the View that shows the contents of this directory. (As the capitalisation of View demonstrates, I am writing "My App" in SwiftUI.)
Working through the aforementioned tutorial, I was unable to figure out how to achieve the described outcome; this might have to with my quite limited experience of to manipulating UIViewControllers, which I have managed to avoid so far with SwiftUI.
Any guidance on this matter would be highly appreciated.
For those looking for a pure SwiftUI and code-only approach way of solving the problem of importing media/data into your app, the most straightforward solution I found was to use .fileImporter in a View. An excellent explanation and example code is available here. The only drawback is that your app is not on the sharesheet but that is okay, in my opinion/use case.
The beauty of this solution is that:
It is code only and doesn't require you to mess around with the info.plist file to define the UTI as per this tutorial
better yet, you do not deal with the Share Extensions and the corresponding ShareViewController, which is no fun to figure out for a purely SwiftUI-based developer.

How do I implement a Document Provider Extension in Xamarin?

I maintain a store of encrypted data I would like to expose to other applications. Right now the data requires a passcode to unlock/decrypt that data.
The document provider extension I created so far doesn't seem to be loading (I checked the certificates) and I can't expose that to the other apps.
Are there any examples of how to do this?
I've already looked at the official documentation, the Git repository of various team members of Xamarin, and all the other general sources.
Are there any special gotcha's I need to address and may be missing?
This should give you a good start : https://forums.xamarin.com/discussion/16071/encryption-decryption-in-xamarin
And to get a complete working solution. Refer the Kinder Chat app.
https://github.com/xamarin/KinderChat
Hope that helps

Uploading pdf files stored in iphone to server in ios

I am making an iphone application which is pretty much like forum. People can ask question and upload a pdf/doc file along with the question. Is there a way to access the pdf/doc file in iphone when user clicks upload button and send the file to server?
I have implemented the feature for image for which I used UIImagePicker to pick the image and send it to the server with http request. But I am completely lost and have no idea how to handle pdf/doc files in same manner.
Any help/suggestion really appreciated. Thanks in advance.
If you want to upload PDF and Doc files, then you can integrate Dropbox and Google Drive in your app and then select the files ,as Apple does not have centralised storage. If you notice Apple also chooses the documents from Google Drive while composing a mail.
So implementing and integrating google drive and Dropbox would be a good option.
Here is the link for Dropbox https://www.dropbox.com/developers-v1/core/sdks/ios
Here is the link for Google Drive https://developers.google.com/drive/ios/quickstart
Implementing Google drive is a bit hard but dropbox is quite simple.
Wish it saves your time. All the best!
I think you are looking for a combination of two things (both have been discussed here before and I include the links below).
(1) store a PDF. There are many options but the best way is to allow coredata to save outside the persistent store. Then store the reference to the file in core date. See: Insert a PDF file into Core Data?
(2) send the file to the server. There are many options for this as well. The fastest is probably to use a wrapper library such as ASIHTTPRequest. See: File Upload to HTTP server in iphone programming

IOS | Storing blog posts for reading later

I'm rather new to IOS but i managed to get my app to display a list of blog posts from RSS feeds. I would like to give my users the ability to save the blog posts for reading later when they might not have an internet connection.
I will do this through a setting in the settings bundle. I do not however know what the best way is to store blog posts within my app. I am already using core data, would this be a good option for it?
If you are already using a persistence option then use it for everything, don't mix and match.
If you are already using Core Data then yes it makes sense to keep using it throughout the application for consistency and maintainability.

Which one is better for social networking integration in iOS development?

I have searched on net for social networking integration in iOS projects (For example: Facebook, Twitter, etc)
I found there are also SDKs available for particulars and some OpenSource projects/frameworks are also available for the same which combines all into one like (ShareKit).
What is the difference in those two? Which one is better to use? Is there any problem to upload an app on AppStore which is using ShareKit framework/code?
Thanks in advance.
Mrunal
If you are using ARC in your project ShareKit is a big waste of time.
Twitter can be added very easily using the Twitter framework and TWTweetComposeViewController. Not sure about any others.
#mrunal check Socialize out: http://www.GetSocialize.com and see what you think. Full feautre list at http://go.GetSocialize.com/features
DROdio
If you are only looking to use Twitter and Facebook, then it is simple enough to just use their API and implement it in your code.
If you are new to development or want to use more (Delicious, Tumblr, Read It Later, Bit.ly, Mail), then I would highly recommend using ShareKit. It allows for sharing of text, URLs and even images. It takes less than an hour to setup even when using ARC and comes with a sample app to play around with. It is also easy to update when more features are added or the API of one the sites changes.

Resources