π± Publishing IPA When Using Native Interop in .NET MAUI

Table of contents
- π Introduction
- π§ Prerequisites
- 1οΈβ£ Setup a Valid Provisioning Profile
- 2οΈβ£ Configure SDKs & Native Libraries in the iOS Binding Project
- 3οΈβ£ Ensure Proper Linking with XcodeProject
- 4οΈβ£ Check for "Do Not Embed" in Xcode
- 5οΈβ£ Build Each Project Individually β
- 6οΈβ£ Building & Publishing the IPA
- π― Conclusion

π Introduction
When working with Native Interop in .NET MAUI, integrating Swift or Objective-C code via Native Bindings requires extra steps while publishing your iOS app. π²
This guide covers the essential steps to ensure your app is correctly signed, linked, and uploaded to the App Store. β
π§ Prerequisites
Before you proceed, make sure you have:
βοΈ A .NET MAUI project with Native Interop (Swift/Objective-C binding).
βοΈ An Apple Developer Account with the necessary certificates & provisioning profiles.
βοΈ Xcode & Visual Studio (Mac or Windows with a Mac build agent).
βοΈ A physical device for testing before publishing.
1οΈβ£ Setup a Valid Provisioning Profile
π οΈ 1.1 Ensure Correct Build Configuration
Before building your IPA, ensure that your main .NET MAUI iOS project has a valid provisioning profile:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios|AnyCPU'">
<CodesignProvision>Apple Distribution</CodesignProvision>
<CodesignKey>Apple Distribution: Testing, Inc. (LKCGHZJYCR)</CodesignKey>
</PropertyGroup>
πΉ Use Manual or Automatic provisioning based on your workflow.
βοΈ This ensures your app is correctly signed for distribution.
βοΈ You can verify profiles in Xcode β Settings β Accounts β Manage Certificates.
2οΈβ£ Configure SDKs & Native Libraries in the iOS Binding Project
Your iOS binding library project must include all necessary SDKs and native references. Make sure your .csproj
file contains the correct settings:
<NativeReference Include="StripePaymentSheet.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="Stripe3DS2.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="StripeApplePay.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="StripeCore.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="StripePayments.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="StripePaymentsUI.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<NativeReference Include="StripeUICore.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>true</ForceLoad>
<Frameworks>UIKit Foundation</Frameworks>
<Visible>true</Visible>
</NativeReference>
<BundleResource Include="StripePaymentSheet.xcframework/**/Stripe_StripePaymentSheet.bundle" />
πΉ ForceLoad = true
ensures the framework is forcefully loaded at runtime.
πΉ SmartLink = False
prevents the linker from stripping required code.
πΉ Include all necessary frameworks like UIKit
, Foundation
, etc.
3οΈβ£ Ensure Proper Linking with XcodeProject
To properly link your native Xcode project, include the following in your csproj
:
<XcodeProject Include="../native/NewBinding/NewBinding.xcodeproj">
<SchemeName>NewBinding</SchemeName>
<!-- Metadata applicable to @(NativeReference) will be used if set, otherwise the following defaults will be used: -->
<Kind>Framework</Kind>
<SmartLink>true</SmartLink>
<IsCarthageFramework>false</IsCarthageFramework>
<Visible>False</Visible>
</XcodeProject>
β
Key Configurations:
βοΈ <Kind>Framework</Kind>
ensures it's recognized as a framework.
βοΈ <SmartLink>true</SmartLink>
optimizes the linking process.
βοΈ <IsCarthageFramework>false</IsCarthageFramework>
if not using Carthage.
4οΈβ£ Check for "Do Not Embed" in Xcode
π Final Step Before Publishing!
1οΈβ£ Open your project in Xcode.
2οΈβ£ Go to Project Navigator (β + 1) β Select your project.
3οΈβ£ Under Frameworks, Libraries, and Embedded Content, ensure that any linked libraries (like .framework or xcframework files) are set to "Do Not Embed".
5οΈβ£ Build Each Project Individually β
Before attempting to publish the IPA, make sure that each project (including the native binding project, the iOS project, and the .NET MAUI project) builds successfully.
6οΈβ£ Building & Publishing the IPA
Run the following command:
dotnet publish -f net9.0-ios -c Release -p:RuntimeIdentifier=ios-arm64
π― Conclusion
Publishing an IPA with Native Interop in .NET MAUI requires proper provisioning, linking, signing, and checking embedding settings in Xcode. By following these steps, you can successfully deploy your app without issues. π
π¬ Questions or issues? Drop a comment below! ππ₯
Subscribe to my newsletter
Read articles from Ali Raza directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ali Raza
Ali Raza
π Tech Lead | .NET MAUI Expert | Mobile App Developer I'm Ali Raza, a passionate Tech Lead with over 6 years of experience in mobile app development. I specialize in .NET MAUI/Xamarin and have led multiple high-impact projects, including enterprise apps, fintech solutions, and eSIM technology. πΉ What I Do: β .NET MAUI & Xamarin β Building cross-platform apps with robust architectures β eSIM & Fintech Apps β Leading innovations in digital connectivity & finance β Performance Optimization β Creating high-quality, scalable mobile solutions β Mentorship & Community Sharing β Helping developers master .NET MAUI π’ Sharing Weekly Insights on .NET MAUI/Xamarin to help developers level up! Follow me for deep dives into Native Interop, API Optimization, and Advanced UI/UX techniques. Letβs connect and build something amazing! π