xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

[iOS/Mac Catalyst] ApplicationTitle is not setting correctly #20615

Open rolfbjarne opened 6 months ago

rolfbjarne commented 6 months ago

From @mhrastegari on Sun, 18 Jun 2023 18:27:22 GMT

Summary

We have several .NET MAUI Blazor projects and we're going to be publish them in Apple store but the <ApplicationTitle>Bit BlazorUI Demo</ApplicationTitle> is not setting correctly!

Screenshots

iOS: Screenshot 2023-06-18 at 21 35 42

macOS: Screenshot 2023-06-18 at 21 37 59

Infos

.NET: 7.0.304 macOS: 13.4 iOS: 16.4

Sample repo

MauiAppTitleIssue.zip

Copied from original issue dotnet/maui#15717

rolfbjarne commented 6 months ago

From @ghost on Mon, 19 Jun 2023 03:49:09 GMT

Hi @mhrastegari. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

rolfbjarne commented 6 months ago

From @drasticactions on Mon, 19 Jun 2023 03:50:10 GMT

Can you create a project with what values you tried to change and where to reproduce what your screenshots show? It'll help so we can know exactly what you tried to change.

rolfbjarne commented 6 months ago

From @mhrastegari on Mon, 19 Jun 2023 15:45:22 GMT

Sure, just added at the bottom of the issue @drasticactions

rolfbjarne commented 6 months ago

From @mkArtakMSFT on Mon, 19 Jun 2023 16:33:39 GMT

@drasticactions which area should I move this issue to? Doesn't seem to be Blazor specific.

rolfbjarne commented 6 months ago

From @mhrastegari on Mon, 19 Jun 2023 18:48:26 GMT

Yeah, it's not related to Blazor @mkArtakMSFT

I think @jsuarezruiz should replace Blazor label with Mac Catalyst.

rolfbjarne commented 6 months ago

From @mhrastegari on Mon, 02 Oct 2023 20:35:28 GMT

@drasticactions Will it be fixed in .NET 8 GA? because I'm on RC1 and the MacCatalyst app name issue is still there!

rolfbjarne commented 6 months ago

From @axylophon on Tue, 10 Oct 2023 05:42:13 GMT

We have the same issue when setting the in the csproj file with a space between two words. On iOS the space is then missing.

Does anybody has a workaround?

rolfbjarne commented 6 months ago

From @jaosnz-rep on Fri, 26 Jan 2024 06:58:57 GMT

Verified this issue with Visual Studio for mac 17.6.8 (build 400). Can repro on iOS platforms with sample project. MauiAppTitleIssue.zip

rolfbjarne commented 6 months ago

From @daltzctr on Thu, 09 May 2024 15:41:46 GMT

This is still an issue.

rolfbjarne commented 6 months ago

From @daltzctr on Thu, 09 May 2024 16:40:10 GMT

Workaround: https://github.com/dotnet/docs-maui/issues/1843

rolfbjarne commented 6 months ago

From @daltzctr on Thu, 09 May 2024 17:17:01 GMT

Another fun tidbit. If the assembly name has spaces in it, it breaks debugging. A simple condition to the property fixes that.

rolfbjarne commented 6 months ago

From @daltzctr on Fri, 10 May 2024 16:54:57 GMT

For iOS, the removal of spaces is intended behavior per https://stackoverflow.com/questions/44275567/how-can-i-add-spaces-to-the-app-name

rolfbjarne commented 6 months ago

From @rolfbjarne on Mon, 20 May 2024 08:46:49 GMT

This is kind of interesting, on iOS the name of the app bundle isn't visible anywhere for the end user, while for Mac Catalyst it's apparently quite visible.

Should we come up with a public MSBuild property for this? And then .NET MAUI's $(ApplicationTitle) could also set it?

Seems like just making _AppBundleName default to $(ApplicationTitle) for Mac Catalyst (and macOS as well I suppose) in our props file would do it.

Moving to xamarin/xamarin-macios, because that's where this should be fixed.

rolfbjarne commented 4 weeks ago

Workaround (from #21478):

  1. Pass -p:_AppBundleName="Actual App Title" to dotnet publish.
  2. Set CFBundleExecutable=Actual App Title in the Info.plist.
  3. Pass -bl:msbuild.binlog to dotnet publish as well, and upload msbuild.binlog if it still doesn't work.