I'm trying to associate my iPhone application to open image files such as jpeg and png. I did it this way:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>public.image</string>
</array>
</dict>
</array>
But this solution doesn't work. If I replace public.image with, for example, public.objective-c-source my app begins to open objective-c source code. But when I use public.image or public.jpeg it doesn't work.
Can you tell where is my mistake? Thank you for answer.
As per this question in apple developer forum (You need to login to devforums.apple.com to see this link), it is not possible. The reason mentioned there is as follows,
Not allowed, it means you will high jack the default behavior of the
iOS camera & photo app. Register a file type unique to your app.
Related
I changed the code ![CDATA[<key>UIDeviceFamily</key><array><string>2</string></array>]] with ![CDATA[ <key>UIPrerenderedIcon</key><true/><array><string>2</string></array>]] but it didn't work. Why is that?
Why did you include FLASH CS5 in your title?
Anyway, question has been answered before here:
Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device
This shows how to make it apply to emulator and iOS 5 hardware.
Specifically,
`
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon#2x.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
`
It would be useful if you wrote where did you change that line. However it seems a fragment of an Info.plist and as such, your changed line has an invalid format. Try something like this:
<key>UIPrerenderedIcon</key>
<true/>
<key>UIDeviceFamily</key>
<array><string>2</string></array>
Also check out if you have the prerendered icon value set in "Icon files (iOS5)" dictionary as described in Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device
My app targets iphone, but obviously it can also be installed on iPad.
On iPhone it uses the correct icon image; on iPad 2, it also uses the correct icon.
However on iPad 3, instead of using icon as icon, it uses my launch image as icon. Is this the usual behaviour on iPad 3? or is my setting wrong? (I uses the latest SDK, and targets iOS 5.0, if this matters)
Update
I attached the plist file below. I guess I can understand what's wrong... Default#2x.png is the name of the launching image. What puzzles me is that, this does not match what I see in Xcode on the "Summary" screen though. In Xcode on the summary screen:
I have retina icon set to SOF_app_icon.png, and I do not have a non-retina icon set - it says "no image specified";
I have two launching images set: Default.png for non-retina, and Default#2x.png for retina.
Here is the plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>SOF_app_icon.png</string>
<string>Default#2x.png</string>
</array>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.overwaitea.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSZombieEnabled</key>
<false/>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>location-services</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>corelocation</key>
<string>YES</string>
</dict>
</plist>
It uses the launch image (i.e. the image displayed while your app is still loading after launch)? That doesn't make any sense. It certainly isn't the normal behavior, and I would guess that you have made a mistake in your Info.plist icon entries.
Note that you need to supply a 2x icon for iPad 3... see the cornucopia of information that Apple supplies.
If you post a copy of your Info.plist (with any sensitive information redacted), along with your icon file names, we can probably nail down exactly what's going wrong.
As a final note, I have noticed that development copies of apps can get slightly out of whack vis-a-vis assets such as icons, seemingly because Xcode is trying to decrease launch time by only copying assets it thinks have changed. For this reason, it's probably a good idea to actually delete the app from the device/simulator and reinstall from scratch just to make sure you aren't seeing stale information.
EDIT: Thanks for posting the Info.plist. This clears up some things.
Let's start with the line:
<string>Default#2x.png</string>
Do you see that, inside your icon files setting, this is telling iOS to use your launch image as an icon? I'm guessing this was a typo, but I want to make sure you aren't confusing what the different plist keys are for.
Had the same problem
All icon files added to the iphone project (including icon-72.png, icon-72#2x.png, Icon-Small-50.png, Icon-Small-50#2x.png).
Than added the iPad files manually to the info.plist file. It showed that order matters.
Putting them at the end didn't work.
My order is now
Icon.png
Icon#2x.png
Icon-72.png
Icon-72#2x.png
and that worked for me.
For the record, Xcode 4.3.1 uses CFBundleIconFiles 3 and 4 for the launch images for apps targeting the iPhone. I cleared the launch images in the summary window and deleted the items in info.plist to be sure I wasn't the one causing the problem, and Xcode always set the launch images the same slots when re-added.
Change
<string>SOF_app_icon.png</string>
<string>Default#2x.png</string>
to
<string>SOF_app_icon.png</string>
<string>SOF_app_icon#2x.png</string>
How you have it configured is telling the device to set the retina icon as the retina version of your "Default" image.
To clarify "Default.png and Default#2x.png" are the standard names for your launch (splash) images.
Solution is simple,
In your plist->icon files-> Default.png and Default#2x.png may be added ! Just remove it from pList,
It Works
I am currently trying to remove the gloss effect from an iOS icon using XCode 4.
I have set the 'Icon already includes gloss effect' (UIPrerenderedIcon) property to YES/true.
The gloss effect is successfully removed from the icon when i run my app through the iPhone 5.0 simulator.
However, the gloss effect is still visible when I run the app through the iPhone 4.3 simulator.
Can anyone tell me how to disable the gloss effect in both iOS versions?
My info.plist file reads as follows
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon#2x.png</string>
<string>Icon-72.png</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon#2x.png</string>
<string>Icon-72.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
I had the same problem. "CFBundleIcons" works for iOS 5.0 and "CFBundleIconFiles" works for 4.3.2 and 5.0. 4.3.2 doesn't recognise the newer "CFBundleIcons" icon property. I solved this by including a "UIPrerenderedIcon"=true at the top-level to match the "CFBundleIconFiles" array. The nested "UIPrerenderedIcon" key in your example code only applies to iOS 5.0. You should skip the "CFBundleIcons" if you want to field for both 4.3.2 and 5.0.
I think your plist should look like this (removing the "CFBundleIcons" array):
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon#2x.png</string>
<string>Icon-72.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
Search for "CFBundleIcons" on this page: http://developer.apple.com/library/IOs/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/App-RelatedResources/App-RelatedResources.html
Clean your build, delete from simulator/Device..! It will work
The technical document states that you must ensure that this value is boolean and not a string litteral "YES". Check if you have correct value defined by viewing plist as a source list.
I have been working on this for awhile for an app that I have been working on. The app is able to open up different files from other apps like mail for example. I have it working on the iPad but I need it to work on the iPhone as well. I ran into a problem with testing it on the iPhone, however, because the exported file extensions that I have in the UTExportedTypeDeclarations section in the info.plist file of the app are not able to be touched in mail on the iPhone.
Here is what I have in the UTExportedTypeDeclarations section:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.myapp.ext</string>
<key>UTTypeDescription</key>
<string>Generic</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>ext</string>
</array>
</dict>
</dict>
</array>
I also have this in this in the corresponding CFBundleDocumentTypes :
<dict>
<key>CFBundleTypeName</key>
<string>Generic</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.ext</string>
</array>
</dict>
In conclusion it is not reading the .ext file extension on the iPhone but it is on the iPad.
Any help would be much appreciated.
Thank you
I'm currently developing an app that needed to associate with different file types (PDF and all the image file types) so far I've managed to associate my app with PDF files but the problam is when i tried to do the same with image files it just doesn't work.
is it even possible to associate PNG, JPG etc to you app ?
If it is, am i doing it right ? (the same way i took care of the pdf through the app plist "CFBundleDocumentTypes" )
I'll really appriciate any kind of help
For example, try adding this to your application. Make sure you have an Icon named DocumentIcon.png that is 22 px by 29 px.
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>DocumentIcon.png</string>
</array>
<key>CFBundleTypeName</key>
<string>My App Name</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>org.gnu.gnu-zip-archive</string>
</array>
</dict>
</array>
This will work for opening files of type .gz. However, if you change the LSItemContentTypes to public.image or public.jpeg, it won't work.
I am having the same issue... I believe this doesn't work because applications like Mail on the iPhone display images as images and not attachments...I have noticed that if I change my setup to use any other file type this does work.