My question is about changing default icon.png content programmatically.
I have free application with Icon (with Lite/Free word inside)
I have In-App purchase inside this app (buy full version)
I click and accept this purchase
Some app content is unlocked
Also, I want my default Icon.png to be changed as well (replace it with NON Lite/Free word inside for example)
I saw this approach in some games but did not buy them to see the results.
You cannot change the application's icon at runtime. This is because it is in the application's bundle, which cannot be modified. Access to the application's bundle is restricted for security. Each bundle is code-signed by a certificate obtained through Apple's developer portal, which guarantees this condition.
To conclude, any files inside the application's bundle, like icons, or the Info.plist file, cannot be changed.
I am sure since you have purchased it you don't have source code.. but still try to look for image icon which must be in application folder.. just delete that icon and put whatever image you want with the same image name.. Also for that one.. you might have to install folder navigation icon. And then you can look in which folder it is install.. I ain't sure but it might be something called /app or /data. I am most of the time playing with android so I know for android where to look.
Thanks
Related
I can read that changing the app icon programmatically at runtime is not possible, at least since iOS 3.0.
But... I regulary can see on "App" websites apps that can put icons on the springboard. The first I remember is that kind of app that you give a friend's picture from your album, and it creates an icon so you can call him just clicking on that icon:
http://itunes.apple.com/fr/app/speedtouch-the-best-home-screen/id378360978?mt=8
http://itunes.apple.com/fr/app/desktop-shortcut/id421701004?mt=8
http://itunes.apple.com/fr/app/appbutler-app-organizer/id327391626?mt=8
http://itunes.apple.com/fr/app/tap4music/id365578914?mt=8
So I guess, is it still impossible to change the app icon programmatically at runtime?
Update
Apple have changed this, you can do this now: https://developer.apple.com/documentation/uikit/uiapplication/2806818-setalternateiconname
Original Answer
What you're thinking of here are WebClips, which are basically shortcuts to websites on the home screen. An actual application cannot change it's icon at runtime, as it's defined in the static Info.plist file.
The only exception to this rule is Newsstand applications.
This is now possible in iOS 10.3 using the UIApplication.setAlternateIconName(_:completionHandler:) API.
See my answer to this question: https://stackoverflow.com/a/44966454/233602
Changing your actual icon (other than, e.g, badging) would require changing the app bundle. I'm pretty sure that you don't have write access to the bundle, and in any event this should change the code signature, causing the OS to prevent launching.
So, no. Apps can put links to web sites, but not change their own app.
We have an updated version of our app icon to replace the existing one, we tried to simply overwrite the old one (image file) with the new version (image file), build and then deploy, what we found on the device is still the old icon being used for our app. Is this a normal behavior, what's the "official" steps for such needs? Note that we are still in development stage, which is why we need to update our app icons based on the new art work done by our designers.
Even i faced the same issue ,& its just because the app still has the reference to the old icon file or may be it has not been deleted from the resources, you may have opted for reference only while deleting the app icon.
It's simple ,
For easy followup I have attached the Screenshots too : ;)
1) Delete your application icon.png from the app, selecting an option "Also Move to Trash" .
2) Now Clean build & all the targets.
3) Reveal in finder the resource folder in your app & first copy your New App icon over there.
4) Now, drag & drop the new application icon from application finder to your Resource folder, make sure to check the option to copy items.
5) Also, prior to submitting the application to AppStore, make sure to do changes in your .plist file.Add value icon.png value to Icon file key.
Once, you are done with all the steps, just reset your Simulator & Run the app. I am sure that would solve your problem.
First of all delete the icon.png then select the image you want to create the icon select and drag it and put the following place and clean up your project(Cmd + shift + k).
Now the run the project and it change the icon of the application.
i think it's helpful for you
do cmd+k (to clean) then cmd+r (to run)
Clean build folder first before you redeploy, Xcode cache some of the data. To clean build folder, Go to Products, and hold option, there will be an option to.
Reference Apple Technical docs, about Troubleshooting section. That technical document gives details about this icon issue.
The following is what I encounter.
Error: Invalid Image Path
Your application's information property list references one or more icon images that were not included in the compiled bundle.
If your application is using asset catalogs to manage its icons then the information property list should not include any icon related keys; they will be added at build time by the asset catalog compiler.
Open the information property list for your app's target. It can be found under the Info tab in the project editor or in the File Navigator where it will be named either -Info.plist or Info.plist, where is the name of your app.
Remove the following keys, including device specific variations.
“Icon file” (CFBundleIconFile)
“Icon files” (CFBundleIconFiles)
CFBundleIcons
My project use App Icons Source to manage app icons, but the Info.plist also contains Icon files, and images in the resources.
More ...
If you encounter following case, reference that apple docs, it will help you.
The wrong icon appears in the App Store
Your application bundle includes additional images which are being detected as valid icon images.
Just wondering if it's possible to add a button like the "Clear History", "Clear Cookies" etc buttons in the Safari preferences to your own app's settings bundle? Been digging through the dev docs and can't find any plist specifier for a button, so I'm wondering if this is an internal API for the Apple guys?
After you hit the button, you get an action sheet asking you whether you really want to do it, and then presumably there is some callback based on the user's input.
Also noticed that the Nike + iPod settings have a clear button in them, but again, that app might have access to internal APIs that we don't.
No, this is not possible. The system only supports interacting with the values from within your app. You can't run code from the settings app so a button would be useless.
Nike+iPod is a root application. Anything running under root can run code from basically anywhere (with restrictions, Sandbox is a b**ch) If you're interested you can make a jailbreak preferencebundle with Theos or iOSOpenDev! Which allows you to make a root bundle that can run button action code.
iOSOpenDev, which extends Xcode for iOS jailbreak-style project development, provides project templates that have a check boxes to include either a simple PreferenceLoader (plist-based) or a full PreferenceLoader bundle.
I've got an iPhone app with icon file Icon.png.
This icon shows up properly when the app is on the phone itself, but it doesn't show up in the applications pane in iTunes.
What do I need to do to get it to show up properly?
The cleanest way to do this is described in the official Apple documentation, in a section called Publishing Applications for Testing. Below is the exact instructions given to you on that page:
The iTunes artwork your testers see should be your application’s icon. This artwork must be a 512 x 512 JPEG or PNG file named iTunesArtwork. Note that the file must not have an extension.
After generating the file of your application’s icon, follow these steps to add it to your application:
Open your project in Xcode.
In the Groups & Files list, select the Resources group.
Choose Project > Add to Project, navigate to your iTunesArtwork file, and click Add.
In the dialog that appears, select the ”Copy items” option and click Add.
Note that the PNG or JPEG file is just 'iTunesArtwork', with no suffix.
If you try to copy the file into the application bundle after you have built it, it will break the app signing, and you will get a verification error when trying to sync it to your device. Ensure that the artwork file is included in the "Copy Bundle Resources" folder, within your project's target in XCode (step 4, above).
Create a 512x512 png of your icon, name it "iTunesArtwork" (no extension, no quotes) and add it to your project under Resources. Then build.
More details here:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/000-Introduction/introduction.html
In order to make it easier for those arriving at this post, here are the actual instructions (straight from the blog post linked from the accepted answer).
There has been some talk on twitter about how to create your own IPA file for your iPhone app, so I thought I would give the instructions that I have used to build an IPA before. Enjoy.
Create a folder on your desktop called “working”. Open that and create another folder inside of it called “Payload” (case-sensitive)
Move your iTunesArtwork file into the “working” folder and your .app into the Payload folder.
Open Terminal and run the following command: chmod -R 775 ~/Desktop/working/Payload
Go into your ProgName.app folder within Payload.
Double-click the Info.plist file. Make sure there is a item called: SignerIdentity with a value of: Apple iPhone OS Application Signing. If there is not, add it.
Zip it all up. Zip the iTunesArtwork and Payload folder. (So zip up what is inside of the working folder)
Rename the zip file to have the name you want, and the extension of ipa.
Double click to install with iTunes
Actually, it is possible to provide iTUnes icons for iPhone software released as ad-hoc. See this blog post for more information.
I'll just add my recent experience. I had fooled around trying to get my ad hoc app to show up in iTunes with an icon (strictly, iTunesArtwork). Finally, I was convinced I had followed the instructions to a 'T' but it still wouldn't show up in the grid view. However, my artwork was properly displayed in the Cover Flow view. I deleted and reinstalled my app from/to iTunes to no avail. Then I quit iTunes and restarted - and, voila! - my artwork was correct in all places. It appears there is some kind of caching that is not reset in Grid view.
If you see a black square instead of you icon in iTunes, be sure that file type of iTunesArtwork in Xcode isn't "image.png". If so, in the copy resource build phase, CopyPNGFile will crash the file which invalid save for iOS divices.
Open your project in Xcode.
Copy iTunesArtwork.png file into project folder.
Edit iTuneArtwork.png file and remove .png from iTunesArtwork.
Generate build.
You can see image on iTunes.
The application icon only shows up in iTunes if your app is distributed through the app store.
I assume you are asking about a developer or ad hoc build. Those get the default black "A" icon.
I've got an iPhone app with icon file Icon.png.
This icon shows up properly when the app is on the phone itself, but it doesn't show up in the applications pane in iTunes.
What do I need to do to get it to show up properly?
The cleanest way to do this is described in the official Apple documentation, in a section called Publishing Applications for Testing. Below is the exact instructions given to you on that page:
The iTunes artwork your testers see should be your application’s icon. This artwork must be a 512 x 512 JPEG or PNG file named iTunesArtwork. Note that the file must not have an extension.
After generating the file of your application’s icon, follow these steps to add it to your application:
Open your project in Xcode.
In the Groups & Files list, select the Resources group.
Choose Project > Add to Project, navigate to your iTunesArtwork file, and click Add.
In the dialog that appears, select the ”Copy items” option and click Add.
Note that the PNG or JPEG file is just 'iTunesArtwork', with no suffix.
If you try to copy the file into the application bundle after you have built it, it will break the app signing, and you will get a verification error when trying to sync it to your device. Ensure that the artwork file is included in the "Copy Bundle Resources" folder, within your project's target in XCode (step 4, above).
Create a 512x512 png of your icon, name it "iTunesArtwork" (no extension, no quotes) and add it to your project under Resources. Then build.
More details here:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/000-Introduction/introduction.html
In order to make it easier for those arriving at this post, here are the actual instructions (straight from the blog post linked from the accepted answer).
There has been some talk on twitter about how to create your own IPA file for your iPhone app, so I thought I would give the instructions that I have used to build an IPA before. Enjoy.
Create a folder on your desktop called “working”. Open that and create another folder inside of it called “Payload” (case-sensitive)
Move your iTunesArtwork file into the “working” folder and your .app into the Payload folder.
Open Terminal and run the following command: chmod -R 775 ~/Desktop/working/Payload
Go into your ProgName.app folder within Payload.
Double-click the Info.plist file. Make sure there is a item called: SignerIdentity with a value of: Apple iPhone OS Application Signing. If there is not, add it.
Zip it all up. Zip the iTunesArtwork and Payload folder. (So zip up what is inside of the working folder)
Rename the zip file to have the name you want, and the extension of ipa.
Double click to install with iTunes
Actually, it is possible to provide iTUnes icons for iPhone software released as ad-hoc. See this blog post for more information.
I'll just add my recent experience. I had fooled around trying to get my ad hoc app to show up in iTunes with an icon (strictly, iTunesArtwork). Finally, I was convinced I had followed the instructions to a 'T' but it still wouldn't show up in the grid view. However, my artwork was properly displayed in the Cover Flow view. I deleted and reinstalled my app from/to iTunes to no avail. Then I quit iTunes and restarted - and, voila! - my artwork was correct in all places. It appears there is some kind of caching that is not reset in Grid view.
If you see a black square instead of you icon in iTunes, be sure that file type of iTunesArtwork in Xcode isn't "image.png". If so, in the copy resource build phase, CopyPNGFile will crash the file which invalid save for iOS divices.
Open your project in Xcode.
Copy iTunesArtwork.png file into project folder.
Edit iTuneArtwork.png file and remove .png from iTunesArtwork.
Generate build.
You can see image on iTunes.
The application icon only shows up in iTunes if your app is distributed through the app store.
I assume you are asking about a developer or ad hoc build. Those get the default black "A" icon.