Skip to content

[iOS] Add documentation for using alternate app icons on iOS and tvOS.#53

Merged
davidbritch merged 19 commits intodotnet:mainfrom
rolfbjarne:alternate-app-icons
Dec 4, 2024
Merged

[iOS] Add documentation for using alternate app icons on iOS and tvOS.#53
davidbritch merged 19 commits intodotnet:mainfrom
rolfbjarne:alternate-app-icons

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

@rolfbjarne rolfbjarne commented Oct 29, 2024

Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
@rolfbjarne rolfbjarne marked this pull request as ready for review November 1, 2024 08:31
Comment thread docs/ios/TOC.yml Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always sentence case.

Comment thread docs/ios/TOC.yml Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always sentence case.

Copy link
Copy Markdown

@davidbritch davidbritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last lot of changes.

Comment thread docs/ios/app-fundamentals/index.md Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not really meant to do these type of index pages anymore, because they add nothing (basically just duplicating the links in the TOC). IIRC there are only two such pages in the MAUI docs, and they are for links from the IDE.

So I'd delete this.

Comment thread docs/ios/index.yml Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value here should be dotnet-mobile, then an ms.subservice of dotnet-ios.

I'll fix it in the Android docs.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, delete the ms.service line here. It's not needed. The config is coming from docfx.json.

Comment thread docs/ios/app-fundamentals/images-icons/index.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd delete this and put a colon on the end of the previous sentence.

Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
Comment thread docs/ios/app-fundamentals/images-icons/alternate-app-icons.md Outdated
rolfbjarne and others added 2 commits November 1, 2024 14:54
Co-authored-by: David Britch <davidbritch@users.noreply.github.com>
Comment thread docs/ios/TOC.yml Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TOC needs updating now that the index page has been removed.

@davidbritch
Copy link
Copy Markdown

So the issue blocking publication is that the content links to samples that are in a private repo.

They're currently in a private repo, and it may take some time until they're
made public. At that point I'll re-add the links.
@rolfbjarne
Copy link
Copy Markdown
Member Author

rolfbjarne commented Nov 4, 2024

So the issue blocking publication is that the content links to samples that are in a private repo.

I removed the links to the samples, and I'll add them back (in a different PR) when the samples repo is made public.

@davidbritch
Copy link
Copy Markdown

Just took another look at this, and while the page titles use sentence case the headings still need converting to sentence case (e.g. Adding Alternate Icons to a .NET Project should be Adding alternate icons to a .NET project).

rolfbjarne added a commit to dotnet/macios that referenced this pull request Nov 4, 2024
This adds support for including all app icons in the app, as well as for specifying alternate app icons.

Including all app icons is enabled by setting the following MSBuild property:

```xml
<PropertyGroup>
    <IncludeAllAppIcons>true</IncludeAllAppIcons>
</PropertyGroup>
````

This will make the `ACTool` task pass `--include-all-app-icons` to `actool` when compiling the asset catalog.

Specifying alternate app icon(s) is enabled by setting the following MSBuild item:

```xml
<ItemGroup>
    <AlternateAppIcon Include="MyAlternateAppIcon" />
    <AlternateAppIcon Include="MyOtherAlternateAppIcon" />
</ItemGroup>
```

Note that the included value is the name if the icon in question, not the path or the filename of the actual icon file (this way there's no need to have different items for different platforms, because there are some platform differences with regards to paths and icon file extensions).

In order to make the behavior consistent, this PR also adds support for specifying the app icon itself using an MSBuild property (in addition to the existing Info.plist property `XSAppIconAssets`, which will eventually be deprecated):

```xml
<PropertyGroup>
    <AppIcon>MyAppIcon</AppIcon>
</PropertyGroup>
```

The same note applies here: the value is the name of the icon.

Note about platforms: the code is there for all platforms (iOS, tvOS, macOS and Mac Catalyst), but alternate app icons only seem to work for iOS and tvOS. `UIApplication.SupportsAlternateIcons` always returns `false` on Mac Catalyst (googling only find people in the same situation), and macOS doesn't have this API to begin with (nor anything similar):

Also:

* Add a bunch of tests.
* Document on our website: dotnet/docs-mobile#53
* Samples for iOS and tvOS: dotnet/macios-samples#2

Fixes #12790.
Fixes #20182.
@rolfbjarne
Copy link
Copy Markdown
Member Author

Just took another look at this, and while the page titles use sentence case the headings still need converting to sentence case (e.g. Adding Alternate Icons to a .NET Project should be Adding alternate icons to a .NET project).

I think I fixed them all now.

I think we should wait with merging this until the new feature has actually been released though (should be the next service release after .NET 9).

@davidbritch davidbritch added the do-not-merge Do not merge label Nov 5, 2024
@rolfbjarne
Copy link
Copy Markdown
Member Author

Just took another look at this, and while the page titles use sentence case the headings still need converting to sentence case (e.g. Adding Alternate Icons to a .NET Project should be Adding alternate icons to a .NET project).

I think I fixed them all now.

I think we should wait with merging this until the new feature has actually been released though (should be the next service release after .NET 9).

The feature has been released so this is good to go now.

The samples repository is also public now, so I re-added the links to the samples.

Copy link
Copy Markdown

@davidbritch davidbritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@davidbritch davidbritch removed the do-not-merge Do not merge label Dec 4, 2024
@davidbritch davidbritch merged commit 9428e50 into dotnet:main Dec 4, 2024
@davidbritch davidbritch deleted the alternate-app-icons branch December 4, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants