Repository navigation
Description
Description
Considering using Avalonia for my iOS development. Technically, I like what I see and I can see a way through to my completed app. However I'm now wondering if it's feasible to get such an app approved by Apple and in the App Store itself...
First up is the question of using a dylib. I've been looking to do some advanced AVFoundation stuff and the path I'm looking at is to create an Objective-C dylib that consumes AVFoundation and then exposes a PInvoke-friendly API to my dotnet/Avalonia app. Early technical feasibility prototype looks good, but as I researched I ran into "is it allowed to use dylibs in iOS ?". The answer on the thread from the Apple employee is; "You need to build a framework from the source code, starting from the Framework template in Xcode. Technote 2435 has the info you need." Ugh.
Second, I need to consume a 3rd party iOS Framework that exposes some private APIs for some specialty hardware. So far I haven't found any references online to consuming an iOS Framework from DotNet, only PInvoke to Objective-C dylibs per above. Investigations into "can I consume an iOS Framework from a dylib" aren't bearing any fruit either...
Lastly, there's a detailed article on the hoops necessary to make an app bundle for MacOS, but I don't see equivalent documentation for iOS. Similar steps will be needed I assume? Has anyone broken this ground yet to get a signed package that can be uploaded to Apple for App Store submission and review?
Reproduction Steps
Dream of a day when Swift and Objective-C die a well deserved death and dotnet/c# take their rightful throne on the realm of app development.
Expected behavior
Apple submits to the inevitable destiny of C#'s ascendance and stops designing puke-worthy languages because "Think Different".
Actual behavior
"Think Different" means "do it the Apple way, or Take The Highway".
Regression?
Closed platforms that have to deal with arbitrary exclusions like "dylibs aren't accepted, just because we say so" is definitely a step backwards.
Known Workarounds
Convince the rest of the world to stop buying closed ecosystem based products.
Work in progress.
Configuration
No response
Other information
No response
Activity
EgorBo commentedon Oct 11, 2023
Shouldn't it be simple to wrap any dylib into a framework?
JayToltTech commentedon Oct 11, 2023
@EgorBo Pasting the conversation with Apple about that idea (see "is it allowed to use dylibs in iOS ?"):
Apple Reply:
JayToltTech commentedon Oct 11, 2023
Also, @EgorBo do you know of a pointer to documentation on how to consume a framework from a dotnet 7.0/8.0 app? I haven't found a good pointer to this as of yet.
EgorBo commentedon Oct 11, 2023
I just remember that I hit a similar issue with App Store nd essentially, the framework is just a folder with your dylib and a plist, that's it (probably, with different rules for the name used in DllImport.)
EgorBo commentedon Oct 11, 2023
Perhaps @akoeplinger can give the exact pointers
JayToltTech commentedon Oct 11, 2023
It seems they have an app review rule against including a dylib, according to the conversation above:
"your app can't contain standalone executables or libs other than a valid CFBundleExecutable"
Is there a way to link a static lib into the app and then PInvoke against its functions?
JayToltTech commentedon Oct 11, 2023
Looks like this is good guidance. Giving this a shot.
https://news.ycombinator.com/item?id=13888038
https://developer.apple.com/library/archive/technotes/tn2435/_index.html
SmartmanApps commentedon Oct 11, 2023
@JayToltTech
Just wanted to say I love the sense of humour - do you mind if I share a screenshot on Mastodon? 😂
JayToltTech commentedon Oct 12, 2023
SmartmanApps commentedon Oct 12, 2023
Thanks! dotnet.social/@SmartmanApps/111219163456518144
akoeplinger commentedon Dec 11, 2023
Sorry, I missed the ping here. You should be able to create a framework that is acceptable to the AppStore like this: https://stackoverflow.com/questions/48701584/how-to-properly-embed-3rd-party-dylib-files-in-ios-app-project-for-app-store-re/62962641#62962641