What is the difference between Apple's iMessage template or adding an extension to an existing app? - iphone

I have noticed this different regarding the creation of messages apps for iOS 10.
If you create a new project using iMessage Application choice on the new project's template, Xcode will create two targets, an app and an extension.
but the project is not able to run.
(see by this second picture that there is only one choice on the target selector at the bottom and that target is the extension).
When you create a normal app, like a single view app and then add a target that is an app extension of the type iMessage, you will have two targets there, the app and the extension.
My questions are:
Xcode iMessage's template is in fact creating just an extension, right? Not an app plus an an extension, correct?
If this is true, why in heavens name is Xcode creating the app target? What is the purpose of having an app target that compiles and appears on the products section with the extension .app if that is not in fact an app and will never run?
Or is in fact the extension just like a "remote control" running the code that is on the app? This is confuse, because by mistake I dragged a lot of content to the project and marked both targets to have them and the final thing doubled size, because the assets were copied to both targets.
The final question is: what will be submitted to Apple, just the extension or both?

Just to clarify -- iMessage extensions created using the template do not appear on the home screen. They only appear in the Messages app. If you add an iMessage extension to an existing app using the "Add Target" menu in Xcode, you are embedding your extension in a host app which appears on the home screen.
From what I can tell the job of the "app target" is literally to just sit there and hold your product name. In Beta 1, I believe the target didn't even have build settings. As of now, it has build settings but no build phases, and I'm guessing it will stay that way.
It does, however, appear in the Products folder after building, which makes me think it will somehow get submitted to the app store with the extension. Regardless, if you make sure your files' "Target Membership" is only set to the extension you should avoid any unnecessary size increase.

My guess is to make the whole thing consistent. I mean when you do an other extension (keyboard, widget etc) this has to come with an app. Here the situation is a bit more complex, we can do an iMessage app that will run by itself, or as an extension of an existing app... So when they developed the SDK they had to keep both way, but that's just a guess :)
Also I'm pretty sure that when submitting the iMessage app to the store, the main target will go with it, as it is the case with all other actual extensions.

Related

How can I fix "Size Limit Exceeded" for my Apple Watch app?

Every time I try to submit an update for my app, I get this error:
I have literally removed all assets from the app except for the .Swift files, storyboard, and the plists. So I know for a fact that the app is not more than 50MB. Yet, I continue to get this error, no matter what else I remove from the app.
I have restarted Xcode, restarted my Mac, changed the build number, removed assets, and nothing is changing.
Anybody have any ideas?
I emailed Apple and they helped me to find the problem. My watchOS app was configured to have duplicate copies of the Swift runtime libraries, one in the watchOS app, and another copy in the watchOS app extension.
I had to go to the extension's project settings, and set Always Embed Swift Standard Libraries to No.

iPhone - Change icon of the app programmatically at runtime

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.

how to update app icon for my iPhone 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.

What do I need to do to configure a new iPhone project so it can be seen as the same as my current iPhone app in the Appstore?

I currently have an app in the Appstore. I need to make changes to the app, but they are significant enough that we've decided it would be easier to create a new Xcode project from scratch rather than modify our existing project. I don't fully understand everything that goes into an iPhone application, just enough to support the code and make basic changes. But I assume that the binary I upload to the Appstore, to replace my existing code there, needs to be similar enough so Apples sees it as the "same" code. What things in the new project do I need to make sure are the same as the old project so Apple knows it's the "same" app?
I've compared the Info.plist file in both projects to make sure they're the same. I only needed to change the bundle identifier in the new project to match the old. Also, the Product Name has been modified to be the same. I don't know if these changes are necessary, but they are the sort of things that I think need to be the same. Are there others? If so, what are they?
The only thing that matters, as far as the app store is concerned, is the app id (Bundle identifier). You can rename the app, change the icon, upload an entirely different program, whatever. As long as the app id matches, the store considers it the same.
Other things I would check are the Build Settings if the defaults are not suitable or the Code is having issues compiling and the Build Phases and Build Rules for all your Targets.
Essentially if your Code compiles fine and you have no issues within the Application then the Bundle Identifier and the name (Basically the Info.plist) needs to be the same to replicate.
Edit: If you have migrated from an older Xcode version then you may have different Build Settings and Build Phases. I would just see if compilation is okay and the App works properly in functionality under all your Targets

Icon is not changed after update of an app

I have created a new version of iPhone app. I wanted to change the icon, so:
I added the icons in different sized to the Resources folder of my Project in XCode:
I specified the icon files in the info.plist file:
in iTunes Connect I added new version of my app and replace the old icon with the new one. The new icon is now visible when I log in to iTunes Connect.
The effects:
I can see the new icon when I run my app on simulator.
I can see the new icon when I visit AppStore with iTunes on my Mac.
I can see the OLD icon when I visit AppStore on my iPhone.
I can see the OLD icon on my iPhone after upgrading my app to the new version.
Any ideas why the old icon is still visible in some of the places?
kind regards,
Jakub
Use "Build > Clean all Targets" and then build and run. Xcode doesn't always see that images have been updated, and leaves them out of incremental builds. Cleaning before building makes Xcode build the app file from scratch, and will pick up any images it's failing to get.
Why it's inconsistent is that different build types (simulator vs device) are different build targets, and got built with different versions of your images. Not unusual.
The one thing that this WON'T address is the old icon on the iPhone's app store app. You might need to update your app store submission with fresh images.