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

Fix iOS link error for apps consuming .nupkg for 4.0.0 #255

Merged
merged 1 commit into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Com.OneSignal.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,13 @@

<!--Xamarin.iOS Unified-->
<file src="Com.OneSignal.iOS\bin\Release\*OneSignal.*" target="lib\Xamarin.iOS10" />

<!-- Workaround to support .XCFramework for iOS -->
<!-- Resources includes the full OneSignal.XCFramework.
iOS.Binding project has NoBindingEmbedding = true so it isn't also bundled in the .dll -->
<file src="OneSignal.iOS.Binding\bin\Release\OneSignal.iOS.Binding.resources\**" target="content\Com.OneSignal.iOS.resources" />
<!-- This is a .target files that gets used by project that consumes the NuGet package.
This copies out the OneSignal.xcframework from the resources folder and adds a NativeReference to it in the app project. -->
<file src="OneSignal.iOS.Binding\Com.OneSignal.targets" target="build\Xamarin.iOS10\" />
</files>
</package>
16 changes: 16 additions & 0 deletions OneSignal.iOS.Binding/Com.OneSignal.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="BeforeCompile">
<ItemGroup>
<BindingResources Include="$(MSBuildThisFileDirectory)../content/Com.OneSignal.iOS.resources/**/*.*" />
</ItemGroup>
<Copy SourceFiles="@(BindingResources)" DestinationFolder="$(TargetDir)/Com.OneSignal.iOS.resources/%(RecursiveDir)" ContinueOnError="false" />
<ItemGroup>
<NativeReference Include="$(TargetDir)/Com.OneSignal.iOS.resources\OneSignal.xcframework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>True</ForceLoad>
<Frameworks>SystemConfiguration UserNotifications WebKit CoreGraphics UIKit</Frameworks>
</NativeReference>
</ItemGroup>
</Target>
</Project>