Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Notification Service Extension Not Working in TestFlight Release Build #24737

Open
oouali opened this issue Sep 12, 2024 · 12 comments
Open
Labels
area-core-platform Integration with platforms partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Milestone

Comments

@oouali
Copy link

oouali commented Sep 12, 2024

Description

I am experiencing an issue with the notification service extension in my app. The extension works perfectly when building and running the app locally in development mode. However, when I build the app for release and upload it to TestFlight, the notification service extension does not function properly. The following error appears in the device logs when attempting to use the extension:

"No service extension record found for app"

This issue only occurs in the TestFlight build, not in the local development build.

In the main app's .csproj file, I have added the following:

<ProjectReference Include="path-to-notification-service-extension.csproj">
    <IsAppExtension>true</IsAppExtension>
    <IsWatchApp>false</IsWatchApp>
</ProjectReference>

Steps to Reproduce

  1. Create a File > New .NET MAUI App with a Notification Service Extension.
  2. Build the app locally and verify that the notification service extension works as expected.
  3. Build the app for release and upload it to TestFlight.
  4. Test the notification service extension in the TestFlight version of the app.
  5. Check the device logs for the error: "No service extension record found for app".

Link to public reproduction project repository

No response

Version with bug

8.0.20 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@oouali oouali added the t/bug Something isn't working label Sep 12, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@oouali oouali changed the title Notification Service Extension Not Working in TestFlight Release Build [iOS] Notification Service Extension Not Working in TestFlight Release Build Sep 12, 2024
@mattleibow
Copy link
Member

@rolfbjarne thoughts?

@mattleibow mattleibow added platform/iOS 🍎 partner/macios Issues for the Mac / iOS SDK area-core-platform Integration with platforms labels Sep 12, 2024
@mattleibow
Copy link
Member

Those steps to create a " .NET MAUI App with a Notification Service Extension"

Where is this from? Is this a template or is it you own composition? Are you able to attach a sample project where this happens to make sure it is configured correctly?

With "Build the app for release" can you share your exact command line args or build steps that you do to make sure things are not going wrong. Maybe attach a binlog of this for the iOS team to investigate.

@mattleibow mattleibow added s/needs-info Issue needs more info from the author s/needs-repro Attach a solution or code which reproduces the issue labels Sep 12, 2024
@rolfbjarne
Copy link
Member

@oouali can you also share the .ipa you uploaded to TestFlight with us?

@mattleibow mattleibow added this to the Backlog milestone Sep 12, 2024
@oouali
Copy link
Author

oouali commented Sep 16, 2024

Those steps to create a " .NET MAUI App with a Notification Service Extension"

Where is this from? Is this a template or is it you own composition? Are you able to attach a sample project where this happens to make sure it is configured correctly?

I've used the following methods:

https://vladislavantonyuk.github.io/articles/Extend-.NET-MAUI-application-with-iOS-Extensions/

and generating it using:

https://www.nuget.org/packages/VladislavAntonyuk.DotNetTemplates

and again both methods worked locally but as soon as i deployed it to testflight it didn't.

With "Build the app for release" can you share your exact command line args or build steps that you do to make sure things are not going wrong. Maybe attach a binlog of this for the iOS team to investigate.

dotnet publish -f net8.0-ios -c Release -p:ApplicationDisplayVersion=1.0.0 -p:ApplicationVersion=4 -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="Automatic" -p:PublishProfile=dev

And when building it locally i just use the "play" button found in rider.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author s/needs-repro Attach a solution or code which reproduces the issue labels Sep 16, 2024
@oouali
Copy link
Author

oouali commented Sep 16, 2024

I've observed an issue when building the project with the following configuration in the main app's .csproj file:

<ProjectReference Include="path-to-notification-service-extension.csproj">
    <IsAppExtension>true</IsAppExtension>
    <IsWatchApp>false</IsWatchApp>
</ProjectReference>

In this case, the notification service extension project is neither built nor visible in the list of dependencies. However, when I modify the project reference as follows:

<ProjectReference Include="path-to-notification-service-extension.csproj" />

The notification service extension project does get built and is listed among the dependencies.

I'm not sure if this discrepancy is related to my current issue, as the first example does work when building the project locally.

@oouali
Copy link
Author

oouali commented Sep 23, 2024

Hi @mattleibow,

I wanted to check if you've had a chance to review the message above. I would greatly appreciate any feedback or insights you might have when you get a moment.

@LucaDuttoTD
Copy link

+1 here

I have the exact same issue as @oouali , we followed the same steps for creating a Notification Service Extension using https://www.nuget.org/packages/VladislavAntonyuk.DotNetTemplates and the referencing the extension project has the same dependency problem.

Any luck anyone?
I think an official document on how to create and deploy an iOS Extension would be greatly appreciated...

I've observed an issue when building the project with the following configuration in the main app's .csproj file:

<ProjectReference Include="path-to-notification-service-extension.csproj">
    <IsAppExtension>true</IsAppExtension>
    <IsWatchApp>false</IsWatchApp>
</ProjectReference>

In this case, the notification service extension project is neither built nor visible in the list of dependencies. However, when I modify the project reference as follows:

<ProjectReference Include="path-to-notification-service-extension.csproj" />

The notification service extension project does get built and is listed among the dependencies.

I'm not sure if this discrepancy is related to my current issue, as the first example does work when building the project locally.

@rolfbjarne
Copy link
Member

I've observed an issue when building the project with the following configuration in the main app's .csproj file:

<ProjectReference Include="path-to-notification-service-extension.csproj">
    <IsAppExtension>true</IsAppExtension>
    <IsWatchApp>false</IsWatchApp>
</ProjectReference>

In this case, the notification service extension project is neither built nor visible in the list of dependencies.

You won't need the "IsWatchApp" property, but you'll need the "IsAppExtension" property, otherwise the build won't recognize the extension project as an extension project (it'll be like a library reference, which is something very different).

However, when I modify the project reference as follows:

<ProjectReference Include="path-to-notification-service-extension.csproj" />

The notification service extension project does get built and is listed among the dependencies.

I'm not sure if this discrepancy is related to my current issue, as the first example does work when building the project locally.

Can you get an MSBuild binlog for a build that works and one that doesn't?

@winstonpang
Copy link

Is there any updates on this @rolfbjarne ?

We have a .NET 8.0 iOS app, and everytime you add true with the ProjectReference. The build process no longer recognises the project reference at all, you have to remove the IsAppExtension tag in order for the ProjectRefrence to be valid.

We have tried this in VS 2022 17.12.2 with .NET 9 as well. We have also tried this in Jetbrains Rider.

We have been trying to add app intent's into our app, but without this IsAppExtension being fixed we can't do it at all.

@rolfbjarne
Copy link
Member

Is there any updates on this @rolfbjarne ?

We have a .NET 8.0 iOS app, and everytime you add true with the ProjectReference. The build process no longer recognises the project reference at all, you have to remove the IsAppExtension tag in order for the ProjectRefrence to be valid.

We have tried this in VS 2022 17.12.2 with .NET 9 as well. We have also tried this in Jetbrains Rider.

We have been trying to add app intent's into our app, but without this IsAppExtension being fixed we can't do it at all.

I followed up here: xamarin/xamarin-macios#21717

@johannperez
Copy link

This post, question and answer, was very useful. Thanks.

Still, is there any official documentation/samples on how to do iOS Extensions at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-platform Integration with platforms partner/macios Issues for the Mac / iOS SDK platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants