GKLocalPlayer.Local.FetchItems() Error on Unity

Can you give me a more detailed code or explanation? Please help me.

Hi, I was able to get this code to work: https://gist.github.com/BastianBlokland/bbc02a407b05beaf3f55ead3dd10f808
I created a file at Assets/Plugins/iOS/GeneratedIdentityVerificationSignature.m in my project and copy+pasted the objective-c code into that. In the unity inspector for the file, I ticked the boxes to include the native plugin for the iOS platform and selected GameKit as a framework dependency. Then in my C# script that was handling my GameCenter login flow (the same script where I had been attempting to call GKLocalPlayer.Local.FetchItems()) I have modified the logic to use the new generateIdentityVerificationSignature with a static callback function where I record the public key url, timestamp, signature, and salt someplace that is accessible in my codebase.

I can then use this info to authenticate with my backend service (in my case LootLocker). I’m using Social.localuser.id for the PlayerId.

Good luck!

Thats Worked.

I have used it but FetchItems() parameters doesn’t return anything when I use it on iOS.
Can you give more details about how you made it ?
I am searching web in the last 3-4 days and I am going to be crazy.

Check your Phone settings and ReLogin to Game center account. if thats didnt work well i share my code compare that.

9704774--1385921--Screenshot 2024-03-16 at 2.16.08 PM.jpg

Did you solve this issue? I’m on same page here.

So fun, It is more than a year since I replied, I even left the job already. This thread still alive lol
I hope this thread will be migrated/backup to discussion, I’m afraid I don’t know how to solve it again

Can you try this; Create an link.xml file and write this;(file name must be link)



A great solution for me was using Cross-Platform Native Plugins : Essential Kit (Mobile - iOS & Android). It does all the work GameKit was supposed to do, even logging in Game Center with all the data I need to link it to Unity Authentication, with a modified file the developer sent me. I believe this feature will be available ā€œnativelyā€ in the next version of this plugin.

I don’t know if Unity Authentication needs it, but I’m currently having trouble getting my app approved in the App Store. It only fails on the devices of the app reviewers. On all my other devices and on the devices of my closed beta testers it just works.

I’ve currently implemented the GameKit authentication to authenticate against PlayFab. For that, I need the output of FetchItems (Signature, Salt, TimeStamp, PublicKeyUrl and TeamPlayerId). Are you able to get those values using this asset (incl. the modified file)?

Yes, the new version of the plugin returns Signature, Salt, TimeStamp and etc.

I can confirm that this fix still works, even now, when following the steps provided by everyone here. Thank you very much. It’s unfortunate that there’s still no official working version and only the forks are functional.

I purchased the asset mentioned above from the Asset Store, however it turned out to be more of a hassle, adding unnecessary components to your project if you use it solely for that purpose. It might still be great for its other features, but I’m just commenting on it for that specific use case. I recommend instead following the steps provided by that build and referring to the Unity documentation on linking and signing in with Game Center. However, instead of using ā€˜get salt,’ simply use ā€˜Salt’ directly after fetching the items.

11.August.2024 still working!

ā€œbut it turned out to be more of a hassle with a lot of unnecessary components being added to your projectā€
Just to clarify, our plugin has nearly 11+ features and each feature is separately configurable to be used or not.

If your use-case is solely for the above fix and you don’t target Android, I personally suggest to use the above fix mentioned in the github link above as it will be a quick one.

But, if you target Android too and use separate plugin, our plugin shines in this use-case as we have wrapped(leaderboards, achievements) for both platforms with an unified api. And also it’s constantly maintained from past 10 years and have zero dependencies (for all features including billing). We write the native code ourselves to avoid waiting for fixes by third parties.

In any case, would love to know your feedback (as requested in a DM) to make the product more accessible and useful.

Cheers,
VB Team

Edit on my last post:

Both solutions work fine:

  1. The asset from the Unity Asset Store: Cross Platform Native Plugins - Essential Kit (Mobile, iOS, Android)
  2. The GitHub fix: Apple Plugin FixFetchItem for Unity

Actually, with the asset, you can build directly from your Windows machine. However, with the GitHub fix, it only works when building for iOS from a Mac.

Thank you for your fast support, @Voxel-Busters! if you were that in Discord.

I am unable to build the plugins from my mac. Not sure what I’m doing wrong.
Can someone just share the tar files that I can then import in my project?

Confirm github fix worked for me