@Norman P --
I think the problem(s) I'm running into with IOS MAY be due to using Xcode 7.2.1. Xcode 8.x is the minimum required for proper IOS & Xojo?
@Norman P --
I think the problem(s) I'm running into with IOS MAY be due to using Xcode 7.2.1. Xcode 8.x is the minimum required for proper IOS & Xojo?
I'm also seeing an issue with normal macOS where a Xojo External Method with a parameter of Int32 is not finding the corresponding C-API dylib function with that parameter defined as int32_t. That should absolutely work, right?
@StephenGreenfield @Norman P --
I think the problem(s) I'm running into with IOS MAY be due to using Xcode 7.2.1. Xcode 8.x is the minimum required for proper IOS & Xojo?
For what you're doing Xcode 7 or 8 should be OK as really Xojo just needs to be able to start the simulator & those two versions behave similarly in this regard
@StephenGreenfield I'm also seeing an issue with normal macOS where a Xojo External Method with a parameter of Int32 is not finding the corresponding C-API dylib function with that parameter defined as int32_t. That should absolutely work, right?
I'd expect so yes
@Norman P --
Got Xojo's invocation of the IOS SIMULATOR to access and correctly call dylib, but ONLY if I use soft declare and provide a full path to the dylib.
But trying to use the External Method approach didn't work for IOS as it had for macOS -- it results in a compile-time error, "this item does not exist", for each of the External Methods I call.
HOW I SET UP THE EXTERNAL METHODS:
Even explicitly setting each External Method's Lib field to the same exact path as I provided for soft declare results in the compile-time error "this item does not exist" for each call.
In both cases (soft declare and External Method) the dylib was compiled for i386 architecture. That worked perfectly with soft declare and IOS Simulator.
Is there any documentation, FAQ, tutorial, etc. that discusses the library path for calling one's own dylib / framework for an IOS project?
As for submission to the app store I am not 100% sure if they will or will not accept apps with dylibs in the Frameworks dir of the app package
@Norman Palardy --
I'm happy to package my library for IOS by any method (dylib, Framework, or Xcode-linked .a file) that allows it to become part of the Xojo-generated app but it MUST get into the app store. There MUST be an absolute sure-fire route to do so, Right? Otherwise the thousands of IOS MonkeyBread functions offered by @Christian Schmitz wouldn't function on IOS?
I have a large, deep, and battle-tested library of non-UI cross-platform C++ code with a C-API that is essential to work with the Xojo front end on ALL platforms.
@StephenGreenfield There MUST be an absolute sure-fire route to do so, Right?
I expect there is for the very reasons you said but
@Norman P I am not 100% sure
:P
@Norman P -- Xojo support god Jason is presently researching the answer on C/C++ library (dylib, framework, et al) inclusion as part of an IOS app submitted to the Apple App Store. But seeing as this very basic question has taken two days (so far) to research, I'm getting a bit nervous...
The App submission guidelines are usually very thorough about what is / isn't permitted
They don't explicitly say this is or is not allowed
I havent spoken to Jason so it could be he's put the question to our Apple Support Rep and that can take time to get an answer
I'm reasonably sure this is OK (google "ios using a dylib in your app" and you get a pile of hits)
Plus
- Apple gives you "how to's" on doing this with a "framework" which is a header + dylibs (and maybe other resources like images)(https://developer.apple.com/library/content/technotes/tn2435/_index.html )
At the very least I suspect you could make this a framework and then its certainly OK and the declares are not much different just the location
- there are several discussions on StackOverFlow about this https://stackoverflow.com/questions/4733847/can-you-build-dynamic-libraries-for-ios-and-load-them-at-runtime , https://stackoverflow.com/questions/37257763/can-i-compile-c-library-into-dylib-and-use-them-in-ios-9-project (and several others)
Now Apple _may_ have changed the rules and require an app extension (that I'm not sure of)
But I sure cannot find anything from them that says a dylib loaded this way is NOT ok
App submission with library is not a problem.
I did submit a FileMaker based iOS app with my plugins.
If you follow all the rules, they allow that.
@ChristianSchmitz -- Thanks -- I didn't see this before I emailed you earlier.
I wonder if the rules for what is permitted is different for FILEMAKER (because Apple owns FIleMaker, Inc) than for Xojo? Do your own MBS IOS plug-ins make calls into a custom IOS Framework during IOS runtime?
As I am beginning to understand the picture, a Xojo use must:
1) generate a Framework -- not a bare dylib -- which gets included in the Xojo app "package". Of course, it must be properly signed.
2) To make calls into that Framework, Xojo IOS uses MUST use soft declare and NOT External Method definitions, correct?
3) Callbacks into the main Xojo code from the Framework are permitted by Apple?
Xojo has no plugin SDK for iOS, but FileMaker has one.
The plugin is just another framework the app loads.
So your MBS functions for IOS are via your own IOS Framework? And those are called via soft declares?
my iOS stuff for Xojo is only Xojo source code without a library/framework.
Thanks, Christian -- then I guess I need to find someone else that has actually made calls into their own IOS Framework!
I thin Jean Paul Devulder did some stuff for iOS that uses his own dylib
BUT I could be wrong
You could PM him
He's on here reasonably frequently
@Norman P -- yes, Paul Devulder has created his own Framework that integrates into an IOS project. He has shared that with me, and I think I see the process involved.
However, he hasn't tried submitting a Xojo-generated IOS app containing his Framework to the IOS App Store. I'm not certain if anyone has.
However, as @ChristianSchmitz states above, he has submitted an app to the IOS App store that contains his own Framework(s). So it seems doable.
@Garth H -- You mentioned earlier:
I use a "callback" - I send the AddressOf of a Xojo function to the DLL, and call that.
Do you have a simple example of this process? When calling from a Windows DLL vs a macOS dylib, is there a different calling convention to pass parameters back from the C-API code to the Xojo callback function?
#Pragma Directives Keyword
Scroll to X86CallingConvention.
Cool! So stdCall on Windows -- but for macOS? CCDecl?