Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Apple.CloudKit Unity Plugin with iCloud Key-Value Storage #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jjb3rd
Copy link

@jjb3rd jjb3rd commented Mar 28, 2023

Added Apple.CloudKit native Unity Plugin that implements iCloud Key-value storage from the NSUbiquitousKeyValueStore class, including event notifications when values are changed remotely.

Note: This does not include CloudKit (Databases, Containers), iCloud Core Data or iCloud Storage

jjb3rd added 2 commits March 28, 2023 12:01
Added Apple.CloudKit native Unity Plugin that implements iCloud Key-value storage from the NSUbiquitousKeyValueStore class, including event notifications when values are changed remotely.

Note: This does not include CloudKit (Databases, Containers), iCloud Core Data or iCloud Storage
npm pack wasn't including the Plugins folder in the archive because it was picking up the .gitignore (which does ignore the Plugins folder), so an empty .npmignore was added so the Plugins folder would be included in npm pack, but not in git.

Also removed extra copies of package.json and link.xml
@jared-marsau jared-marsau added the Maintainer Viewed Viewed and undergoing evaluation. label Apr 4, 2023
@jonathanleang
Copy link

would be great to add Documentation to the following path
/plug-ins/Apple.CloudKit/Apple.CloudKit_Unity/Assets/Apple.CloudKit/Documentation~/Apple.CloudKit.mdI

trying to find how to use AddObserverForExternalChanges

@jjb3rd
Copy link
Author

jjb3rd commented May 3, 2023

Will do. In the mean time, the sample code implements this in
/plug-ins/Apple.CloudKit/Apple.CloudKit_Unity/Assets/Apple.CloudKit/Demos/Apple.CloudKit.Sample/Scripts/CloudKitSample.cs

Added documentation for Apple.CloudKit plugin.
@jjb3rd
Copy link
Author

jjb3rd commented May 3, 2023

@jonathanleang docs have been added.

@Physicalpariah
Copy link

Physicalpariah commented Sep 18, 2023

I've been banging my head against this one for a couple months on and off (mostly, I assume due to inexperience with bundles), but on mac builds this keeps throwing a DllNotFoundException "no such file". From as far as I can tell, the bundle exists in the expected location. Even when explicitly pointing xcode at it's location it still falls over with a further error saying it's unable to find a particular symbol.

Again, unsure if this is pure inexperience on my half or maybe something is actually up with this.
(also sorry if this is the wrong place to put a bugreport)

Worst yet, it seems to be inconsistent. Some mac devices are fine, others are not. I've tried it on an m2 pro, an i9 from 2019 and an i5 from 2015, the M2pro, and the i9 were fine, but the i5 threw the below errors. I've had bug reports from players using anything from 2013 era devices through to high end m2Max devices. Really at a loss with this one.

Before setting RunPath Search Path explicitly:
DllNotFoundException: Unable to load DLL 'CloudKitWrapper'. Tried the load the following dynamic libraries: Unable to load dynamic library 'CloudKitWrapper' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen(CloudKitWrapper, 0x0005): tried: 'APPNAME.app/Contents/MacOS/Frameworks/CloudKitWrapper' (no such file), 'CloudKitWrapper' (no such file), '/usr/local/lib/CloudKitWrapper' (no such file), '/usr/lib/CloudKitWrapper' (no such file)

After setting RunPath Search Path explicitly:
DllNotFoundException: Unable to load DLL 'CloudKitWrapper'. Tried the load the following dynamic libraries: Unable to load dynamic library 'CloudKitWrapper' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen(CloudKitWrapper, 0x0005): Symbol not found: (_$s10Foundation12NotificationV36_unconditionallyBridgeFromObjectiveCyACSo14NSNotificationCSgFZ) Referenced from: 'APPNAME.app/Contents/PlugIns/CloudKitWrapper.bundle/Contents/MacOS/CloudKitWrapper' Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation

jared-marsau pushed a commit that referenced this pull request Dec 7, 2023
@Abwuds
Copy link

Abwuds commented Jan 11, 2024

Hey thanks a lot @jjb3rd !
Some context:

Main reason we want GameCenter at work is to get the cloud save.
Unfortunately GKLocalPlayer methods are not implemented yet.
Also, we're using Unity 2021 as we're all avoiding 2022+ because of the new Unity prices applying from there.

Right now things aren't working for Unity 2021 and we have to follow these instructions to have things working. + make sure that Unity 2020 distribution contains the iOS modules + make sure frameworks are "embed and sign" in xcode.

Then I merged your changes on top, discarded your 2 conflicts with the documentation and build.py script and fixed the upi_cli_argument_options to add "ClouKit". That's about it.

Why am I saying all this? Because the error @Physicalpariah has is only another symptom of what's blocking everyone and that I discovered by following lots of bug threads regarding unityplugings on Unity 2021 distributions.

the CloudKitWrapper framework must be set to "ember and sign" in xcode UnityFramework target
Also we have to add the iCloud capability to the Unity-iPhone project.

Hope this helps who passes by

Note: Also Thanks to Apple devs for all the work

@Abwuds
Copy link

Abwuds commented Jan 15, 2024

Nevermind

Having them to "embed and sign" does work when building on a device but is not allowed when uploading to App Store Connect. Have to find another solution.

@maurirope
Copy link

@jared-marsau Sorry for bothering my friend but this feature is highly necessary and I'm betting highly requested as well. In the case of our studio this is the only thing preventing us from migrating from outdated plugins yet. What is a reasonable time expectation for this to be merged to main? Thank you very much for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainer Viewed Viewed and undergoing evaluation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants