Fix content sharing from AUv3 iOS

AudioUnits of version three don’t support components added to the desktop. So to use ContentSharer on iOS AudioUnits we need a way to pass a parent component (akin to the FileChooser interface). I’ve created a pull requests that adds an optional Component *parentComponent argument to each sharing method. The iOS native implementation will use the passed component to add it self to the parent component’s peer.

I’m aware of @amethystdeceiver’s work on that topic but from an API point of view prefer passing the component directly at the call over setting a parent component on a singleton class.

3 Likes

It seems the issue is still present, it would be nice to merge that fix.

1 Like

Thanks, this functionality is now on develop:

5 Likes

Great! Thank you :slight_smile:

Awesome, thanks!
Is there any chance the API could also take a component or area from which to show the iOS popover? I think it’s the last bit missing to make the sharer look & feel 100% native.

Anyone got this running?

I’ve just tried it and I end up at:

    virtual void runAsync (ContentSharer::Callback callback)
    {
        jassertfalse;
        NullCheckedInvocation::invoke (callback, false, "Content sharing not available on this platform!");
    }

I call it from a PopUpMenu so with the recent changes I move the ScopedMessageBox to a member of my main component class (the one that calls those)

                    presetsView->shareBox = std::move (messageBox);

Not sure if I’m doing it right.

What platform are you using for testing? Content sharing is only implemented on iOS and Android.

I use this only on my iOS and Android builds.
This was with ios. Had same assertion on Apple silicon Mac and my iPhone SE

Do you definitely have the JUCE_CONTENT_SHARING=1 preprocessor definition enabled?

iOS content sharing seems to work in the DemoRunner running in the Simulator. Perhaps you could look for differences between your project and the DemoRunner.

Thanks @reuk that was it. I’ve migrated this project to CMake and didn’t notice I had this (missing).

Oddly,
CONTENT_SHARING_ENABLED TRUE within juce_add_plugin didn’t work.
(although it’s also not documented in the CMake readme).

The compile definition did work.

Still the target as “My Mac” (Apple silicon) isn’t working (just logging this for anyone reading this in the future).