iOS Question Open custom file type with mail

mrossen

Active Member
Licensed User
Longtime User
Hi,

I am trying to detach at custom file format "lps" from mail, and open it with my own app and save the file

I have followed this links:


But It is a mess for me. I can not se the logic here.

I have got this to work: https://www.b4x.com/android/forum/threads/open-external-files-with-your-app.50525/#content

The file I try to setup with my app is a text file like a windows ini file

It is used to setup a device.

I would like to email a customer this lps file, and he can open it with email, and get it over to my app and then program the device.

But I am stucked!!

Has any one got this thing with custom file types to work.

I have added this to my app

B4X:
    #PlistExtra:<key>CFBundleDocumentTypes</key>
    #PlistExtra:<Array><dict><key>CFBundleTypeIconFiles</key>
    #PlistExtra:<Array>
    #PlistExtra:<string>Icon-iPad-doc320.png</string>
    #PlistExtra:<string>Icon-iPad-doc.png</string>
    #PlistExtra:</Array>
    #PlistExtra:<key>CFBundleTypeName</key>
    #PlistExtra:<string>LPS File</string>
    #PlistExtra:<key>CFBundleTypeRole</key>
    #PlistExtra:<string>Viewer</string>
    #PlistExtra:<key>LSHandlerRank</key>
    #PlistExtra:<string>Owner</string>
    #PlistExtra:<key>LSItemContentTypes</key>
    #PlistExtra:<Array><string>com.lp.imail.lps</string>
    #PlistExtra:<string>Public.comma-separated-values-text</string>
    #PlistExtra:</Array></dict></Array>
    #PlistExtra:<key>UTExportedTypeDeclarations</key>
    #PlistExtra:<Array><dict><key>UTTypeConformsTo</key><Array><string>Public.data</string></Array>
    #PlistExtra:<key>UTTypeDescription</key><string>LPS File</string><key>UTTypeIdentifier</key><string>com.lp.imail.lps</string>
    #PlistExtra:<key>UTTypeTagSpecification</key><dict><key>Public.filename-extension</key><string>lps</string>
    #PlistExtra:<key>Public.mime-Type</key><string>application/octet-stream</string>
    #PlistExtra:</dict></dict></Array>
Mogens
 

Attachments

  • iMail.zip
    18.6 KB · Views: 182

DonManfred

Expert
Licensed User
Longtime User
Is this a B4A question?
 
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
Hi,

I have been over this again and again the last days. With no luck.

It will not compile. If I removes the part after the linie 8 it compiles.

Anyone has at clue to what can be wrong.


B4X:
#PlistExtra:<key>CFBundleDocumentTypes</key>
    #PlistExtra:<array><dict><key>CFBundleTypeIconFiles</key><array/>
    #PlistExtra:<key>CFBundleTypeName</key><string>LPS File</string>
    #PlistExtra:<key>LSHandlerRank</key><string>Alternate</string>
    #PlistExtra:<key>LSItemContentTypes</key><array>
    #PlistExtra:<string>com.lp.imail.lps</string>
    #PlistExtra:</array></dict></array>
    
    #PlistExtra:<key>UTExportedTypeDeclarations</key>
    #PlistExtra:<Array><dict><key>UTTypeConformsTo</key>
    #PlistExtra:<Array><string>public.plain-text</string><string>public.text</string></Array>
    #PlistExtra:<key>UTTypeDescription</key>
    #PlistExtra:<string>imail File</string>
    #PlistExtra:<key>UTTypeIdentifier</key>
    #PlistExtra:<string>com.lp.imail.lps</string>
    #PlistExtra:<key>UTTypeTagSpecification</key>
    #PlistExtra:<dict><key>public.filename-extension</key>
    #PlistExtra:<string>lps</string>
    #PlistExtra:<key>public.mime-type</key>
    #PlistExtra:<string>text/plain</string>
    #PlistExtra:</dict></dict></Array>


Mogens
 
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
Hi,

I have attach the files.

I have renamed the plist file to txt. I could not upload plist extention

Mogens
 

Attachments

  • Build.PNG
    Build.PNG
    16.3 KB · Views: 167
  • Error.png
    Error.png
    55.7 KB · Views: 177
  • B4iProject-Info.txt
    4 KB · Views: 162
Upvote 0
Top