General Tech Bugs & Fixes . 1 year ago

Xcode - Sharing file with custom file-extension works with Airdrop but not via Email, Whatsapp or Skype

Xcode - Sharing file with custom file-extension works with Airdrop but not via Email, Whatsapp or Skype

4 views   1   3 likes   0 shares Tuteehub forum manpreet 1 answers
tuteehub_quiz
Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

profilepic.png

Tuteehub forum answer Answers (1)


profilepic.png
manpreet Tuteehub forum best answer Best Answer 1 year ago

 

I created two custom files which when imported using airdrop works fine but any other way seems to not work properly. The custom files are pretty much folders containing multiple plist and images.

I can send it by email but when I try to open it on the computer using the right software the file shows nothing. if I use Skype, it show the warning "Cannot load representation of type public.file-url"

I am using UIActivityViewController to share the file and below is part of my plist for my custom files.

UTExportedTypeDeclarations

    
        UTTypeConformsTo
        
            public.directory
        
        UTTypeDescription
        custom file extension ATime
        UTTypeIconFiles
        
            Time File Icon
        
        UTTypeIdentifier
        au.com.company.customUTIHandler.ATime
        UTTypeTagSpecification
        
            public.filename-extension
            ATime
        
    
    
        UTTypeConformsTo
        
            public.directory
        
        UTTypeDescription
        custom file extension AData
        UTTypeIconFiles
        
            Time File Icon
        
        UTTypeIdentifier
        au.com.company.customUTIHandler.AData
        UTTypeTagSpecification
        
            public.filename-extension
            AData
        
    

Am I missing something in my plist? Another question mentioned adding the MIME type. I found this site http://lwp.interglacial.com/appc_01.htm which shows the MIME types but didn't know what to use as my custom file is a folder. Below is how the MIME type looks in the plist when added.

public.mime-type
        text/plain/string>

I am not sure why it works fine with Airdrop but not with the other sharing options. Would another option maybe to zip the file? This wouldn't be the most convenient though for the workflow.

Thanks in advance for any input.

Using Xcode 11.4

4 views   0 shares
Related Tags