GKLocalPlayer.Local.FetchItems() Error on Unity

Hello! We were struggled with this error in the past days and we found a workaround. Open the GKIdentityVerificationResponse.cs script and change the GKIdentityVerificationResponse function from internal to public and the error will be solved!

public GKIdentityVerificationResponse(ulong timestamp,
            IntPtr publicKeyUrl, int publicKeyUrlLength,
            IntPtr signature, int signatureLength,
            IntPtr salt, int saltLength)
        {
            Timestamp = timestamp;

            var publicKeyUrlBytes = new byte[publicKeyUrlLength];
            Marshal.Copy(publicKeyUrl, publicKeyUrlBytes, 0, publicKeyUrlLength);
            PublicKeyUrl = System.Text.Encoding.UTF8.GetString(publicKeyUrlBytes);
           
            Signature = new byte[signatureLength];
            Marshal.Copy(signature, Signature, 0, signatureLength);

            Salt = new byte[saltLength];
            Marshal.Copy(salt, Salt, 0, saltLength);

        }

Hello guys! We were having a lot of problems in the past few days with this error in FetchItems and we finally made a build with success and here go some advices:

1 - The GitHub - muZZkat/unityplugins at muzzkat/fix-fetch-items branch fixes the FetchItems Bad Access error in IOS build.
2 - Make sure you are in muZZkatā€™s branch, you have to enter the git and checkout to fix-fetch-items branch.
3 - To make sure if you are in muZZkatā€™s branch, the functions GetSignature() and GetSalt() must be missing. You have to change those functions with .Signature and .Salt variables.
4 - If your Unity Editor logs an error saying that the script doesnā€™t have access/permission to the class, go to GKIdentityVerificationResponse.cs script and change the GKIdentityVerificationResponse() function from internal to public.

5 Likes

did anyone successfully use muzzkat/fix-fetch-items fix and verify on the server side something seems not vaild.
edit: found what i did wrong, it works, use Team Player ID not Game Player Id

for people @AndreaMar who have problem with android build on windows crossplatform build is fixed in this PR fix: cross-platform editor compatibility by DodgyTim Ā· Pull Request #7 Ā· apple/unityplugins Ā· GitHub

Please sir, is there any news? The fix I was using https://developer.apple.com/forums/thread/722593 doesnā€™t work with macOS builds.

Hi, I created a fork on github from official Apple/unityplugins:

https://github.com/EpsilonD3lta/unityplugins

and integrated two pull requests:

  1. Fix for correct multiplatform compilation from this fork: https://github.com/dodgy-ltd/apple-unityplugins/tree/cross-platform-fixes
  2. Fix for FetchItems exception from this fork: GitHub - muZZkat/unityplugins at muzzkat/fix-fetch-items

Second fix causes to GetSalt and GetSignature methods change to Salt and Signature fields so you have to use those.
It seems to be working, on client and serverside too, tested on iOS devices, not tested on macOS or anything else.
I used recomended unity 2020.3.33 to build the plugins with command python3 build.py -m iOS. My xCode version is 14.2

3 Likes

@SebT_Unity Is there any news on the fixes? It has been over half a year. On the latest version of Unity 2023.2.0b5, both macOS and iOS cannot build while using the apple plugin.

It is absoluelty pathetic that such a basic function is not fixed.

Thanks for the info! It seems that is obsolete nowā€¦ I donā€™t see any path to using Unityā€™s Authentication on iOS at this timeā€¦ :frowning:

https://docs.unity3d.com/2023.3/Documentation/Manual/net-SocialAPI.html

Itā€™s just awful to see. My current projects work this way. And I donā€™t know at all what to do so that users donā€™t lose their data. The worst part is that there is no replacement, and there doesnā€™t seem to be one.

1 Like

There is a serious issue here, Unity Authentication and cloud saves is unusable if this is not fixed quickly. The normal way of implementing it cannot be by merging a PR of some dude with a commit from another dude.
Even with this fixes, the plugin does not provide necessary data to sign in with Unity.

a disaster going on for more than 6 months

4 Likes

I use authorization mainly to save players data.

Unfortunately I decided to leave unity services and started working on my own, simpler solution on mysql, as I donā€™t see any way out and canā€™t trust solutions from Unity if such simple things canā€™t be fixed for more than half a year. Itā€™s absolutely frustrating

4 Likes

Any Unity developer! Is there any update? How can a paid service be broken for this long?

4 Likes

Hello everyone,
Apologies for the delayed response. We are still collaborating with Apple to provide an update on the Apple Unity plugin for a permanent solution. In the meantime, we wanted to share this document with you that offers a workaround.
Please let us know if you have any feedback on this document, and weā€™ll make updates as necessary. Thank you!

3 Likes

Another workaround for Unity 2021+

it worked for me

HUGE thanks! this worked for me. What a headache the Apple SDK

I believe this response is now outdated. There was a refactoring in the build.py script, which moved or renamed the ā€œBuild Native Librariesā€ part.

Wish there will be a clear path forward for this soon!

Hi MousePods
I finally managed to install everything and build on Unity 2021.3.31.f1, thanks to the muzzkat fixes .
Did you manage to make Cloud save work? Unfortunately I cannot see these Gamekit Cloud save bindings in our Unity wrapper.
Going to try that solution though but Iā€™m not confident itā€™ll work as itā€™s yet another merge from another unofficial branch.

Never mind it worked :slight_smile:
https://github.com/apple/unityplugins/pull/12

1 Like

I am still getting crash,why?

Seriously how can the plugin still have such basic issues six to eight months after its been reported.
Also cross platform games that tries to compile for a different platform on Windows gives a error just for having the apple addon included.

1 Like