0

I have a standard Xamarin Forms application for Android and iOS. I have a file that we generate that is xml inside with a file extension of .PV4

I would like to have my app open when the user taps on it or opens it in any way on Android and iOS.

I have Android working. I am trying to get iOS to work.

I created the following int he info.plist:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>PV4</string>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>pv4</string>
        </array>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.content</string>
        </array>
    </dict>
</array>

At first I tried it without the com.content type. I am not sure what I am missing. I have the file saved on an iPhone 13 and am trying to use the Files app to open it.

When I tap on it it just bring up a view inside the files app giving the name and how many bytes are inside the file.

I have done many searches to try to find the answer and am not finding anything that has helped. I formulated the above from things I found here and there.

Can someone tell me what I need to do in order to have my app open on iOS when the user tries to open a file the the extension .PV4?

  • https://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application – Jason Jul 08 '22 at 22:24
  • That sort of worked. I added the entries specified in that other post and then ran my app in the simulator. When I then dragged a file from my Mac to the simulator home screen it did indeed open my app. I got all excited and loaded my app onto my iPhone and went to the Files app and tapped on the same file that I had downloaded to my iPhone. Files did NOT open my app. It just showed the text inside the file. I then opened the Files app on the simulator with the same results. So if I drag a file to the simulator it works. If I open the file from other apps it doesn't. Any ideas? – TPitman Jul 11 '22 at 16:22

0 Answers0