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

General Tech Bugs & Fixes 2 years ago

4 1 3 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 02 Sep 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years 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

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.