-1

I wanna share a PDF file from APP1 by the function of share extension, but I just got a URL path from method of loadItemForTypeIdentifier,which is a path of APP1 sandbox, I can not get the PDF file by URL,so how can I get the PDF or Doc through the method loadItemForTypeIdentifier?

enter image description here

I tried many types but I can only get NSURL.

MD. Khairul Basar
  • 4,976
  • 14
  • 41
  • 59

2 Answers2

0

If you want share pdf to other app you don't need a share extention.you can do it with documentViewController if to a special app you use activityviewcontroller

kai
  • 1
  • 1
-1

When I assign item to NSData, I get a NSData.

[itemProvider loadItemForTypeIdentifier:fileType options:nil completionHandler:^(NSData *item, NSError * _Null_unspecified error)
                         {
                             NSData *data = (NSData *)item;
                             if ([data isKindOfClass:[NSData class]]) {
                                 weakSelf.dataToSave = data;
                             }
                             blockExcuteCount ++;
                             if (blockExcuteCount == 2 && completion) {
                                 completion();
                             }
                        }];