OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104
stars
50
forks
source link
[Fix] iOS builds on Windows with projects located at normal or long path lengths #317
Resolve most iOS builds failing on Windows due Windows due 260 character file path limits.
Details
Motivation
It is common for Xamarin developers to use a Windows machine and a remote macOS machine to build. Builds were failing unless your project's root was an uncommonly short absolute path.
Scope
Only effects iOS builds, only the linking part to .xcframeworks.
Changes made
Instead of copying the .framework files into the project from the nuget cache via the .targets MSBuild task instead directly reference them.
Renamed Binding Resource files in .target and .nuspec files from content\OneSignalSDK.Xamarin.iOS.resources to res\iOS to shorten the absolute file paths
Example of error this addresses
Error Unable to copy file "C:\Users\Kasten\.nuget\packages\onesignalsdk.xamarin\4.1.0\build\Xamarin.iOS\..\..\content\OneSignalSDK.Xamarin.iOS.resources\OneSignal.xcframework\ios-arm64_armv7_armv7s\OneSignal.framework\Headers\OneSignal.h" to "C:\Users\Kasten\source\repos\XamarinFormsTest2OneSignal4_1_0\XamarinFormsTest2OneSignal4_1_0\XamarinFormsTest2OneSignal4_1_0.iOS\bin\iPhone\Debug\/OneSignalSDK.Xamarin.iOS.resources/OneSignal.xcframework\ios-arm64_armv7_armv7s\OneSignal.framework\Headers\OneSignal.h". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. XamarinFormsTest2OneSignal4_1_0.iOS C:\Users\Kasten\.nuget\packages\onesignalsdk.xamarin\4.1.0\build\Xamarin.iOS\OneSignalSDK.Xamarin.targets 6
Issues this resolves
Fixes #312
Fixes #316
Fixes #319
Testing
Manual testing
Window - remote mac build
Windows 11 Pro 21H2
Visual Studio 2022 Version 17.2.5
Remote mac on macOS 12.3.1
Xamarin.iOS 15.10.0.5
Xamarin.Forms project
Tested on both a real device and a simulator and ensured the OneSignal SDK prompts for notifications.
Mac
MacOS 12.4
Visual Studio 2022 Version 17.05
.Net 6.0.0.262
Xamarin.iOS 15.10.0.5
Xamarin.Forms project
Tested on both a real device and a simulator and ensured the OneSignal SDK prompts for notifications.
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[ ] Sessions
[ ] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[X] I have filled out all REQUIRED sections above
[X] PR does one thing
[X] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[X] I have included test coverage for these changes, or explained why they are not needed
[X] All automated tests pass, or I explained why that is not possible
[X] I have personally tested this on my device, or explained why that is not possible
Final pass
[X] Code is as readable as possible.
[X] I have reviewed this PR myself, ensuring it meets each checklist item
Description
One Line Summary
Resolve most iOS builds failing on Windows due Windows due 260 character file path limits.
Details
Motivation
It is common for Xamarin developers to use a Windows machine and a remote macOS machine to build. Builds were failing unless your project's root was an uncommonly short absolute path.
Scope
Only effects iOS builds, only the linking part to
.xcframeworks
.Changes made
.targets
MSBuild task instead directly reference them..target
and.nuspec
files fromcontent\OneSignalSDK.Xamarin.iOS.resources
tores\iOS
to shorten the absolute file pathsExample of error this addresses
Issues this resolves
Testing
Manual testing
Window - remote mac build
Mac
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is![Reviewable](https://reviewable.io/review_button.svg)