Rajesh Maurya
Rajesh Maurya

Reputation: 3164

How to save document or file from iOS Mail attachment to our application in iOS?

I have seen that google drive is able to save document from iOS mail attachment to google drive. How to do this in our application? I find that we can open document or pdf from iOS mail attachment to our application using UIDocumentInteractionController. But is there any way to save that document into our application.

Upvotes: 0

Views: 662

Answers (1)

Sanju
Sanju

Reputation: 1168

U need to know about Extensions First and types of Extensions

please refer screenshot , In the screenshot My App is integrated with Action Extension , So by Default My App Shows up with UIActivityviewcontreoller(I can Share Images from any APP(Which Contains Images))

enter image description here

Useful Links for Extensions and screenshots for NSExtension Attributes

enter image description here

http://code.tutsplus.com/tutorials/ios-8-how-to-build-a-simple-action-extension--cms-22794

https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/SystemExtensionKeys.html

https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW8

For Documents Extension

  1. Create a new Project and go to file -> create New Target -> select Action Extension and in Plist U need to enable NSExtensionActivationSupportsFileWithMaxCount this to be added in Plist , count to be 1 (1 = allows attachment 1)

  2. Run with Mail Application(attachment share) Ur App Shows on Action Extension

U can achieve with Share extension also not sure

Upvotes: 1

Related Questions