Skip to content

Is it possible to get an Avalonia app published into the Apple iOS App Store? #93366

Open

Description

@JayToltTech

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

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Oct 11, 2023
  2. EgorBo commented on Oct 11, 2023

    @EgorBo
    Member

    Shouldn't it be simple to wrap any dylib into a framework?

  3. JayToltTech commented on Oct 11, 2023

    @JayToltTech
    Author

    @EgorBo Pasting the conversation with Apple about that idea (see "is it allowed to use dylibs in iOS ?"):

    Hi,
    My question is not how to use a dylib but I am wondering whether if they are allowed to use in an app released in AppStore or not.
    My company develops c/c++ cross platform libraries to be used in different environments and now we are trying to use dylibs in iOS, so far we can embed them and call the functions from the libraries successfully, how ever when we submit the app including the dylib to the AppStore, the Apptore validation fails because of the dylib,
    We tried below ways,
    wrapping dylib into framework (dylib is inside the Frameworks folder of framework)
    (Result: Framework contains disallowed file 'Frameworks')
    wrapping dylib into framework (dylib is in root folder of framework)
    (Result: your app can't contain standalone executables or libs other than a valid CFBundleExecutable)
    converting dylib into a fake framework
    (Result: invalid bundle, framework doesn't support the minimum OS version specified in the info.plist file.)
    So, if the dylibs are allowed to use in iOS, we need a documentation about where to put them correctly that will make our app pass the AppStore validation, thanks

    Apple Reply:

    You need to build a framework from the source code, starting from the Framework template in Xcode. Technote 2435 has the info you need.

  4. JayToltTech commented on Oct 11, 2023

    @JayToltTech
    Author

    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.

  5. EgorBo commented on Oct 11, 2023

    @EgorBo
    Member

    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.)

  6. EgorBo commented on Oct 11, 2023

    @EgorBo
    Member

    Perhaps @akoeplinger can give the exact pointers

  7. JayToltTech commented on Oct 11, 2023

    @JayToltTech
    Author

    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?

  8. JayToltTech commented on Oct 11, 2023

    @JayToltTech
    Author

    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.)

    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

  9. SmartmanApps commented on Oct 11, 2023

    @SmartmanApps

    @JayToltTech
    Just wanted to say I love the sense of humour - do you mind if I share a screenshot on Mastodon? 😂

  10. JayToltTech commented on Oct 12, 2023

    @JayToltTech
    Author
  11. SmartmanApps commented on Oct 12, 2023

    @SmartmanApps
  12. added
    questionAnswer questions and provide assistance, not an issue with source code or documentation.
    help wanted[up-for-grabs] Good issue for external contributors
    on Oct 12, 2023
  13. akoeplinger commented on Dec 11, 2023

    @akoeplinger
    Member

    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

  14. added this to the Future milestone on Jun 26, 2024
  15. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Metahelp wanted[up-for-grabs] Good issue for external contributorsos-iosApple iOSquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions