Search Unity

Problem with Game Center achievements

Discussion in 'Scripting' started by willchil, Mar 15, 2015.

  1. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    147
    It works great on iOS 8, but I am curious, has anyone tested this solution on iOS 7.12?
    Thank you!!

    P.S. I tried using the simulator, but I can't make it work.
     
  2. TheSlayerNo1

    TheSlayerNo1

    Joined:
    Feb 7, 2015
    Posts:
    2
    I couldn't get the plugin to work so I ended up making my own. Feel free to use it if you want. Just import this package and replace your call to Social.ReportProgress with GKAchievementReporter.ReportAchievement(achievementID, progress, showsCompletionBanner)
     

    Attached Files:

    eses, Joshdbb, amjaliks and 5 others like this.
  3. timmynz

    timmynz

    Joined:
    Jul 1, 2015
    Posts:
    3
    Does anyone know if this is still an issue? I am having the same problem, can post to leaderboard and view achievements but can't post progress.

    Cheers
     
  4. timmynz

    timmynz

    Joined:
    Jul 1, 2015
    Posts:
    3
    Thanks slayerno1. Your code seems to be working. This seems to have been an issue for a long time now. Thought unity would have fixed this already.

    Anyway thanks again for posting your solution.
     
  5. kreso

    kreso

    Joined:
    Sep 7, 2013
    Posts:
    147
    Hey @timmynz, I have been following major version & patch release notes, and I haven't seen any hint that this was resolved by Unity.
     
  6. timmynz

    timmynz

    Joined:
    Jul 1, 2015
    Posts:
    3
    Thanks to the plugin its now working but I am not receiving any banners on achievement completion. Do you guys know if this is a sandbox issue and should work in the live version. I have GameCenterPlatform.ShowDefaultAchievementCompletionBanner(true); before the authentication call and passing true to GKAchievementReporter.

    Cheers
     
    dan_ginovker likes this.
  7. Divereth

    Divereth

    Joined:
    Sep 25, 2014
    Posts:
    2
    Edit: It was probably my mistake (I have sent "achievementID" instead of achievementID ;) )

    The plugin did not help in my case. Any ideas? Leaderboards work fine. Achievements work only on Android. (Unity 5.0.2f1).
    I get the log that Achievement has been reported successfully (with plugin from this topic), but it does not unlock, neither in sandbox nor in live version of the game.

    also as timmynz said no completion banners.
     
    Last edited: Jul 10, 2015
  8. maxbilbow

    maxbilbow

    Joined:
    Jun 17, 2015
    Posts:
    1
    Absolute legend. Pretty much solved that problem with two clicks.
     
  9. dfjhde

    dfjhde

    Joined:
    May 23, 2015
    Posts:
    8
    awosome!!,thanks, guys
     
  10. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    I could not believe the problem I am dealing with right now (after following the worst Unity references page ever "GameCenterPlayforms"/"Socials" for days) is this hot.. yeah it is still the issue and this problem cause me 12 hours of all-nighter while wondering if I mistyped achievement name or something.
     
  11. prg1

    prg1

    Joined:
    Oct 4, 2012
    Posts:
    9
    that's two hours I work on it without result .thank you a lot
     
  12. superjustin5000

    superjustin5000

    Joined:
    Apr 12, 2015
    Posts:
    16
  13. mrs_gold

    mrs_gold

    Joined:
    Oct 25, 2014
    Posts:
    3
    Good evening everyone!

    Did anyone have a problem with reporting progress smaller then 1%? Like 0.5%? Because every time I do something similar nothing is reported anyway (BTW I'm using TheSlayerNo1 solution which works just fine [thank you TheSlayerNo1 !], but only with progress >= 1%).

    Thanks!
     
  14. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,619
    Certainly still seems to be an issue. Same thing is happening here.

    Edit: For clarity, this is on Unity 5.1.1, haven't updated to 5.2 yet. Also, @TheSlayerNo1's solution immediately fixed things for me as well. Cheers!
     
    Last edited: Sep 29, 2015
  15. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    Last edited: Oct 28, 2015
    rocket5tim and litebox like this.
  16. Erikoinen

    Erikoinen

    Joined:
    Nov 10, 2014
    Posts:
    68
    @marcpeyre Thanks for the excellent plugin. However I'm still not seeing the GC banner even though I've set it to true, and the achievement gets reported (when checked in GC). People here seem to be saying that they have, like @warchild14

    Any tips? :/
     
  17. Erikoinen

    Erikoinen

    Joined:
    Nov 10, 2014
    Posts:
    68
    I THINK I've solved it for me.

    Achievement Banners were not showing up properly. In the first place they didn't show up at all, but then I created a sandbox user in iTunes Connect, and with that they showed up as they were supposed to, for about two sessions. After that they again don't show up at all.

    I created yet another sandbox account, and they were showing properly. When I used GameCenterBinding.resetAchievements and performed the achievements again, the banner didn't show up. So it's likely that they will show up to everyone correctly the first time, and as players don't have the option to reset their achievements, everything works fine.
     
  18. rocket5tim

    rocket5tim

    Joined:
    May 19, 2009
    Posts:
    242
    I'm having the same problem with @TheSlayerNo1 plugin, achievement progress isn't being reported with very small percentages. @mrs_gold did you ever figure out the problem?
     
  19. bpierpont89

    bpierpont89

    Joined:
    Jul 4, 2015
    Posts:
    2
    THANK YOU SO MUCH
     
  20. povilas

    povilas

    Unity Technologies

    Joined:
    Jan 28, 2014
    Posts:
    427
    The bug with achievement banner not showing up the second time and beyond has been fixed. The fix is expected to be in 5.2.3p2.

    We can't however reproduce the achievement reporting errors. Do you observe them with latest 5.2 Unity release?
     
  21. mmoczkowski

    mmoczkowski

    Joined:
    Oct 25, 2012
    Posts:
    6
    ReportProgress doesn't work in 5.2.2p4.
     
  22. jstephenson

    jstephenson

    Joined:
    Oct 6, 2014
    Posts:
    7
    I am experiencing similar issues with Achievements for GameCenter in Unity 5.1.4f1, but my leaderboards are functioning correctly. When I call the function Social.ShowAchievementsUI the Achievements shown match the Achievements set up on iTunes Connect, but when calling the function Social.LoadAchievements, the array it returns has a length of 0, even though Social.LoadAchievementDescriptions returns with correct descriptions. When calling Social.ReportProgress, I recieve the following XCode logs:

    Code (CSharp):
    1. no bundle for bundleID: (null)
    2. Report Progress: False
    3.  
    4. No achivevements returned
    5.  
    6. Looking for achievement_id, cache count is 0
    7. Report Progress: False
    This happens regardless of calling GameCenterPlatform.ShowDefaultAchievementCompletionBanner(true).

    After implementing the Plugin by @marcpeyre, the Achievements are correctly being updated, but I am not receiving Achievement Completion Banners, I am now receiving the Xcode Logs:

    Code (CSharp):
    1. Creating Achievement: achievement_id
    2. no bundle for bundleID: (null)
    3. Achievement Successfully Reported.
    Now that an Achievement has been successfully reported, Social.LoadAchievements is returning an array with a count of 1, this being the Achievement for "achievement_id". I am now thinking Social.LoadAchievements loads achievements that the user has progress in or has completed only and Social.ReportProgress had a cache count of 0 as it has not been reported to yet? Is there a way of getting all Achievements with their current progress from iTunes Connect using the Social API? @povilas

    If not would I have to ReportProgress on all my achievements at the start up of the application, sending a value of 0, so that I can then later use Social.LoadAchievements to get all of them?
     
    Last edited: Dec 9, 2015
  23. rockyourteeth

    rockyourteeth

    Joined:
    Jul 25, 2013
    Posts:
    17
    @marcpeyre, I just wanted to cast my thanks as well, now that it's more than half a year later, and this is still the best solution (@TheSlayerNo1 's may be good too, but I didn't try it).

    @povilas, I can confirm that it's still not working for me.
     
  24. fallingbrickwork

    fallingbrickwork

    Joined:
    Mar 16, 2009
    Posts:
    1,072
    Is this still not working?? I'm unable to Report achievements in 5.3.1p3.

    - Matt.
     
  25. corn

    corn

    Joined:
    Mar 26, 2014
    Posts:
    12
    Not working for me either (5.3.1), ReportProgress, ResetAllAchievements and LoadAchievements are completely broken for iOS. This really needs some fixing, or at least warnings in the docs, it was quite a bummer when I got to testing and realized achievements were completely unusable.

    @marcpeyre, thanks a lot for your solution, works great !
     
  26. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    I just upgraded from 5.1.3 to 5.3.1, and I don't get the achievement banners. However, the achievements indicate they're completed in Game Center.
     
  27. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    98
    Worked like a charm! Thanks!
     
  28. satanas

    satanas

    Joined:
    Nov 7, 2015
    Posts:
    3
    TheSlayerNo1, is there a way to add a callback to your plugin? I don't know Objective-C and I've tried without success.
     
  29. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
    @povilas - let's hear more on this !!!!!!!!
     
  30. Divereth

    Divereth

    Joined:
    Sep 25, 2014
    Posts:
    2
    Any chance this is fixed in 5.3.5f1 and with the new fixes Apple made to Game Center?

    The plugin which fixes it is the only non-bitcode thing in my project so it would be nice to have it working with bitcode.
     
  31. pappaxray2

    pappaxray2

    Joined:
    Mar 30, 2016
    Posts:
    11
    Still occuring in 5.3.5f1 , I'd upvote the bug but it's been resolved as fixed. I think they're having problems reproing it, maybe you need to test with a new user or a new app? Testing with an iPhone 4 here

    Social.LoadAchievementDescriptions works correctly, all my achievements are returned
    Social.LoadAchievements returns a zero sized array

    I'm wondering if it's an issue with the initialisation of the achievements. As I understand it, you're supposed to store the achievement data locally, defer achievements when offline and suppress any duplicate calls to save on unnecessary data transfer. Could it be an issue with the local achievement data?
     
  32. juunishi_master

    juunishi_master

    Joined:
    Nov 12, 2015
    Posts:
    2
    I found this post yesterday, maybe you want to give it a shot?

    I also stuck in this problem until now. Could it possibly related with the achievement and leaderboard being "Not Live" in iTunesConnect before Apple review the app?
     
    Last edited: Jul 26, 2016
  33. tataygames

    tataygames

    Joined:
    Aug 4, 2016
    Posts:
    55
    Hi when I compile it on my xcode it has a bug.

    pls help..!

    I attached the image below
     

    Attached Files:

  34. Tiberius1701

    Tiberius1701

    Joined:
    Sep 16, 2014
    Posts:
    71
    I know this is an old thread, but beating my head against the wall - I tried importing @TheSlayerNo1 package, but no matter what I do my script can't find GKAchievementReporter to call. Can anyone help?

    Kindest Regards,
    Garry