iosobjective-cplistuiactivityviewcontrolleruti

How to define Uniforme Type Identifier in plist to add my iOS app option in share action sheet?


<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>72x72.png</string>
<string>144x144.png</string>
</array>
<key>CFBundleTypeName</key>
<string>JPEG</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.ngnew.NG.ShareJPEG</string>
<string>com.ngnew.NG.ShareJPG</string>
<string>com.ngnew.NG.mime-type</string></array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.jpeg</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG</string>
<key>UTTypeIdentifier</key>
<string>com.ngnew.NG.ShareJPEG</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.ngnew.NG.ShareJPEG</key>
<array>
<string>jpeg</string>
<string>jpg</string>
</array>
<key>com.ngnew.NG.ShareJPG</key>
<string>JPEG</string>
<key>com.ngnew.NG.mime-type</key>
<string>image/jpeg</string>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.image</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG image</string>
<key>UTTypeIdentifier</key>
<string>com.ngios.newios</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
</dict>
</array>

I used the above code in plist but, I couldn't see the result in my app. I referred also to many other example but somewhere I'm doing it wrong.

I want my iOS app option in UIActivityViewController in share action sheet, to share image or text or both to my iOS App.


Solution

  • Solution is ShareExtension (Xcode -> File -> Target -> ShareExtension)